Add1E commited on
Commit
2c190d7
·
verified ·
1 Parent(s): 2432994

Update trend_crawl.py

Browse files
Files changed (1) hide show
  1. trend_crawl.py +8 -6
trend_crawl.py CHANGED
@@ -17,18 +17,20 @@ complete_starttime = time.time()
17
 
18
  # URL of the Google Trends page
19
 
 
 
 
 
20
  def setup_driver():
21
- """Set up the Selenium WebDriver."""
22
- script_dir = os.path.dirname(os.path.abspath(__file__))
23
- driver_path = os.path.join(script_dir, 'chromedriver')
24
  chrome_options = Options()
25
  chrome_options.add_argument("--headless")
26
  chrome_options.add_argument("--no-sandbox")
27
  chrome_options.add_argument("--disable-dev-shm-usage")
28
- chrome_options.binary_location = "/usr/bin/chromium-browser"
29
-
30
- service = Service("/usr/bin/chromedriver")
31
  service = ChromeService(ChromeDriverManager().install())
 
 
32
  return driver
33
 
34
  def process_selenium_row(index, selenium_rows, driver):
 
17
 
18
  # URL of the Google Trends page
19
 
20
+
21
+ #script_dir = os.path.dirname(os.path.abspath(__file__))
22
+ #driver_path = os.path.join(script_dir, 'chromedriver')
23
+
24
  def setup_driver():
 
 
 
25
  chrome_options = Options()
26
  chrome_options.add_argument("--headless")
27
  chrome_options.add_argument("--no-sandbox")
28
  chrome_options.add_argument("--disable-dev-shm-usage")
29
+
30
+ # Let webdriver_manager handle downloading and setting up Chromedriver
 
31
  service = ChromeService(ChromeDriverManager().install())
32
+
33
+ driver = webdriver.Chrome(service=service, options=chrome_options)
34
  return driver
35
 
36
  def process_selenium_row(index, selenium_rows, driver):