@IsaacB1/

web archivver

Python

No description

fork
loading
Files
  • main.py
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from BeautifulSoup import BeautifulSoup
import urllib2
import re
import requests

queue = ["https://www.freekigames.com"]


def main():
  url = queue[0]
  queue.remove(0)
  html_page = urllib2.urlopen(url)
  soup = BeautifulSoup(html_page)
  links = []
  requests.get("https://web.archive.org/save/" + url)
  print(url + " has been archived.")
  for link in soup.findAll('a', attrs={'href': re.compile("^http://")}):
      queue.append(link.get('href'))