Spaces:
Running
Running
Update trend_crawl.py
Browse files- trend_crawl.py +2 -2
trend_crawl.py
CHANGED
@@ -35,10 +35,10 @@ def process_selenium_row(index, selenium_rows, driver):
|
|
35 |
for attempt in range(max_retries):
|
36 |
try:
|
37 |
# Refresh the rows before processing
|
38 |
-
selenium_rows = driver.find_elements(By.CSS_SELECTOR, '[jsname="oKdM2c"]')
|
39 |
row = selenium_rows[index]
|
40 |
driver.execute_script("arguments[0].click();", row) # Use JavaScript click for stability
|
41 |
-
|
42 |
# Wait for the articles to load dynamically
|
43 |
WebDriverWait(driver, 10).until(
|
44 |
EC.presence_of_all_elements_located((By.CLASS_NAME, "xZCHj"))
|
|
|
35 |
for attempt in range(max_retries):
|
36 |
try:
|
37 |
# Refresh the rows before processing
|
38 |
+
#selenium_rows = driver.find_elements(By.CSS_SELECTOR, '[jsname="oKdM2c"]')
|
39 |
row = selenium_rows[index]
|
40 |
driver.execute_script("arguments[0].click();", row) # Use JavaScript click for stability
|
41 |
+
|
42 |
# Wait for the articles to load dynamically
|
43 |
WebDriverWait(driver, 10).until(
|
44 |
EC.presence_of_all_elements_located((By.CLASS_NAME, "xZCHj"))
|