Spaces:
Running
Running
Update trend_crawl.py
Browse files- trend_crawl.py +8 -3
trend_crawl.py
CHANGED
@@ -21,9 +21,14 @@ def setup_driver():
|
|
21 |
script_dir = os.path.dirname(os.path.abspath(__file__))
|
22 |
driver_path = os.path.join(script_dir, 'chromedriver')
|
23 |
chrome_options = Options()
|
24 |
-
chrome_options.add_argument("--headless")
|
25 |
-
chrome_options.add_argument("--
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
27 |
return driver
|
28 |
|
29 |
def process_selenium_row(index, selenium_rows, driver):
|
|
|
21 |
script_dir = os.path.dirname(os.path.abspath(__file__))
|
22 |
driver_path = os.path.join(script_dir, 'chromedriver')
|
23 |
chrome_options = Options()
|
24 |
+
chrome_options.add_argument("--headless")
|
25 |
+
chrome_options.add_argument("--no-sandbox")
|
26 |
+
chrome_options.add_argument("--disable-dev-shm-usage")
|
27 |
+
chrome_options.binary_location = "/usr/bin/chromium-browser"
|
28 |
+
|
29 |
+
service = Service("/usr/bin/chromedriver")
|
30 |
+
driver = webdriver.Chrome(service=service, options=chrome_options)
|
31 |
+
return driver
|
32 |
return driver
|
33 |
|
34 |
def process_selenium_row(index, selenium_rows, driver):
|