From cb88499ac9fafe1b1c0a1184cf9566c3d5315498 Mon Sep 17 00:00:00 2001 From: Sloetjes Date: Wed, 31 May 2023 17:54:08 -0400 Subject: [PATCH] Fixed merge conflicts with NFL zip code script --- NFL Zip Code.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/NFL Zip Code.py b/NFL Zip Code.py index d1bcab0..058c914 100644 --- a/NFL Zip Code.py +++ b/NFL Zip Code.py @@ -8,7 +8,7 @@ from google.cloud import pubsub_v1 # In[2]: # Set the project ID and topic name -project_id = 'svig-384801' +project_id = 'price-extraction-project' topic_name = 'nfl-zipcodes' @@ -82,12 +82,12 @@ from selenium.webdriver.support import expected_conditions as EC from google.cloud import pubsub_v1 # Set the project ID and subscription name -project_id = 'svig-384801' +project_id = 'price-extraction-project' topic_name = 'nfl-zipcodes' -subscription_name = 'nfl-zipcodes-sub' +subscription_name = 'sloetjes' # Set the path to your ChromeDriver executable -chrome_driver_path = "/usr/local/bin/chromedriver" +chrome_driver_path = "/Users/sloetjeswong/Downloads/chromedriver_mac_arm64/chromedriver" # Set up a Google Cloud Pub/Sub subscriber subscriber = pubsub_v1.SubscriberClient() @@ -95,7 +95,7 @@ subscription_path = subscriber.subscription_path(project_id, subscription_name) # Set up a ChromeDriver instance chrome_options = webdriver.ChromeOptions() -#chrome_options.add_argument("--headless") # Run Chrome in headless mode +chrome_options.add_argument("--headless") # Run Chrome in headless mode chrome_service = Service(chrome_driver_path) chrome_service.start() driver = webdriver.Remote(chrome_service.service_url, options=chrome_options) @@ -111,7 +111,6 @@ def callback(message): # Wait for the price to load price_xpath = "//span[@class='price']" - print(EC.presence_of_element_located((By.XPATH, price_xpath))) price_element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, price_xpath))) # Extract the price and print it @@ -130,5 +129,3 @@ streaming_pull_future.result() while True: time.sleep(60) - -# %%