Created
November 29, 2018 03:08
-
-
Save tcprescott/42eb94d0172b2bc04a0db25b0a93db59 to your computer and use it in GitHub Desktop.
GDQ registration scraper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#in the "cookie" variable, replace remember_abc123456 with the name of your remember_* cookie in your browser | |
#and remembertokenhere with the token for that cookie | |
#you can find the cookie in chrome by going into the developer tools while on the page (Control-Shift-I in Windows) | |
#go to Application tab, choose Cookies | |
#uses python 3.6 | |
#pip3 install requests | |
#pip3 install BeautifulSoup4 | |
#pip3 install lxml | |
from bs4 import BeautifulSoup | |
import requests | |
page_link = 'https://gamesdonequick.com/profile' | |
cookie = { | |
'remember_abc123456': 'remembertokenhere' | |
} | |
page_response = requests.get( | |
page_link, | |
timeout=5, | |
cookies=cookie | |
) | |
soup = BeautifulSoup(page_response.text, 'lxml') | |
regcount = soup.find('p', {'class': 'text-center'},text=True).contents[0].contents[0].split(' / ') | |
if int(regcount[0]) < int(regcount[1]): | |
print('GDQ Registrations available') | |
else: | |
print('GDQ registrations unavailable') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment