Fixed merge conflicts with NFL zip code script

This commit is contained in:
Sloetjes
2023-05-31 17:54:08 -04:00
parent f0b8c0fe9d
commit cb88499ac9
+5 -8
View File
@@ -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)
# %%