Spaces:
Runtime error
Runtime error
Nguyen Quang Truong commited on
Commit ·
b116b9e
1
Parent(s): 56070a2
test update
Browse files
scrape_data_indeed/utils.py
CHANGED
|
@@ -11,6 +11,9 @@ import datetime
|
|
| 11 |
import json
|
| 12 |
import os
|
| 13 |
from datetime import datetime, timedelta
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
def init_driver():
|
| 16 |
|
|
@@ -45,8 +48,11 @@ def access(driver,url):
|
|
| 45 |
|
| 46 |
def search(driver, job, location):
|
| 47 |
print("_"*30, "SEARCH","_"*30)
|
| 48 |
-
|
| 49 |
-
search_box_job
|
|
|
|
|
|
|
|
|
|
| 50 |
search_box_location=driver.find_element(By.XPATH, '//input[@id="text-input-where"]')
|
| 51 |
search_box_job.send_keys(job)
|
| 52 |
search_box_location.send_keys(location)
|
|
|
|
| 11 |
import json
|
| 12 |
import os
|
| 13 |
from datetime import datetime, timedelta
|
| 14 |
+
from selenium.webdriver.support.ui import WebDriverWait
|
| 15 |
+
from selenium.webdriver.support import expected_conditions as EC
|
| 16 |
+
|
| 17 |
|
| 18 |
def init_driver():
|
| 19 |
|
|
|
|
| 48 |
|
| 49 |
def search(driver, job, location):
|
| 50 |
print("_"*30, "SEARCH","_"*30)
|
| 51 |
+
|
| 52 |
+
search_box_job= WebDriverWait(driver, 10).until(
|
| 53 |
+
EC.presence_of_element_located((By.XPATH, '//input[@id="text-input-what"]'))
|
| 54 |
+
)
|
| 55 |
+
# search_box_job = driver.find_element(By.XPATH, '//input[@id="text-input-what"]')
|
| 56 |
search_box_location=driver.find_element(By.XPATH, '//input[@id="text-input-where"]')
|
| 57 |
search_box_job.send_keys(job)
|
| 58 |
search_box_location.send_keys(location)
|