From d44581966153e6f4d3b55162f60b9566a2c2088c Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Tue, 28 Aug 2018 23:50:02 -0400 Subject: [PATCH] gecko stuff --- good_sprite.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/good_sprite.py b/good_sprite.py index 0624692..762de40 100644 --- a/good_sprite.py +++ b/good_sprite.py @@ -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):