initial
This commit is contained in:
commit
71c9beeb60
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ENV
|
||||||
|
ghostdriver.log
|
39
good.py
Normal file
39
good.py
Normal 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
2
requirements.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
selenium
|
||||||
|
requests
|
Loading…
Reference in New Issue
Block a user