summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/visit_site.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/visit_site.py b/scripts/visit_site.py
new file mode 100755
index 0000000..abd6a21
--- /dev/null
+++ b/scripts/visit_site.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python3
+
+from bs4 import BeautifulSoup
+import requests
+
+
+def main(url):
+ if not url.startswith("http"):
+ url = "http://" + url
+ if not url.endswith("/"):
+ url += "/"
+ response = requests.get(url)
+ soup = BeautifulSoup(response.text, "html.parser")
+ for link in soup.find_all("a", "link-browse"):
+ href = link["href"]
+ try:
+ requests.get(url + href)
+ except Exception:
+ pass
+
+
+if __name__ == '__main__':
+ from pergamon.settings.local import BASE_URL
+ main(BASE_URL) \ No newline at end of file