gecko stuff

This commit is contained in:
Tyrel Souza 2018-08-28 23:50:02 -04:00
parent 7d576552fd
commit d445819661

View File

@ -45,6 +45,8 @@ def main():
def get_goodreads_stats():
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
payload = {
'email': os.environ.get('EMAIL'),
'password': os.environ.get('PASSW'),
@ -52,8 +54,12 @@ def get_goodreads_stats():
LOGIN_URL= 'https://www.goodreads.com/user/sign_in'
driver = webdriver.PhantomJS()
#driver = webdriver.Firefox(firefox_binary=FirefoxBinary("/usr/bin/firefox"))
print("before driver")
driver = webdriver.Firefox()
print("after driver")
driver.get(LOGIN_URL)
print("after login")
username = driver.find_element_by_id('user_email')
password = driver.find_element_by_id('user_password')
@ -67,6 +73,9 @@ def get_goodreads_stats():
driver.get('https://www.goodreads.com/review/stats/24381583#pages')
pages = driver.execute_script('return page_stats')
books = driver.execute_script('return year_stats')
print("Got stats from goodreads live:")
print(pages)
print(books)
return pages, books
def get_stats(pages, books):