commit b8199cff56503276238ee2abb9efd59b95464386 Author: Beppe Date: Mon Dec 10 21:54:02 2018 +0100 first commit diff --git a/main.py b/main.py new file mode 100644 index 0000000..7355cb3 --- /dev/null +++ b/main.py @@ -0,0 +1,24 @@ +import urllib.request as rq +import urllib.error as err +from bs4 import BeautifulSoup +import sys + +### victim url https://store.steampowered.com/genre/Free%20to%20Play/#p=1&tab=NewReleases + +def get(url): + try: + return rq.urlopen(url).read() + except err.HTTPError as e: + return None + except err.URLError as e: + return None +# supposidly you would loop this until you got a 404 error +def getPage(num, t="newReleases"): + raw_html = get("https://store.steampowered.com/genre/Free%20to%20Play/#p={}&tab={}".format(num,t)) + + html = BeautifulSoup(raw_html, 'html.parser') + r = [] + for a in html.find_all('a', class_='tab_item'): + r.append(a['href']) + return r +