This commit is contained in:
Tyrel Souza 2018-08-28 18:44:44 -04:00
commit 71c9beeb60
No known key found for this signature in database
GPG Key ID: 5A9394D4C30AEAC0
3 changed files with 43 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
ENV
ghostdriver.log

39
good.py Normal file
View File

@ -0,0 +1,39 @@
import requests
import json
import os
from selenium import webdriver
import datetime
def get_goodreads_pages():
payload = {
'email': os.environ.get('EMAIL'),
'password': os.environ.get('PASSW'),
}
LOGIN_URL= 'https://www.goodreads.com/user/sign_in'
driver = webdriver.PhantomJS()
driver.get(LOGIN_URL)
username = driver.find_element_by_id('user_email')
password = driver.find_element_by_id('user_password')
username.send_keys(payload['email'])
password.send_keys(payload['password'])
form = driver.find_element_by_name('sign_in')
form.submit()
driver.get('https://www.goodreads.com/review/stats/24381583#pages')
stats = driver.execute_script('return page_stats')
return stats
def main():
fake_pages = {'2014': 7375, '2015': 23508, '2016': 17696, '2017': 19706, '2018': 9388}
#print(get_goodreads_pages())
if __name__ == "__main__":
main()

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
selenium
requests