Spaces:
Runtime error
Runtime error
Nguyen Quang Truong
commited on
Commit
·
ed2793a
1
Parent(s):
b116b9e
Update_scrape
Browse files
scrape_data_indeed/utils.py
CHANGED
|
@@ -11,8 +11,7 @@ import datetime
|
|
| 11 |
import json
|
| 12 |
import os
|
| 13 |
from datetime import datetime, timedelta
|
| 14 |
-
|
| 15 |
-
from selenium.webdriver.support import expected_conditions as EC
|
| 16 |
|
| 17 |
|
| 18 |
def init_driver():
|
|
@@ -43,16 +42,13 @@ def init_driver():
|
|
| 43 |
def access(driver,url):
|
| 44 |
print("_"*30, "ACCESS URL","_"*30)
|
| 45 |
driver.get(url)
|
| 46 |
-
sleep(
|
| 47 |
|
| 48 |
|
| 49 |
def search(driver, job, location):
|
| 50 |
print("_"*30, "SEARCH","_"*30)
|
| 51 |
|
| 52 |
-
search_box_job=
|
| 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)
|
|
|
|
| 11 |
import json
|
| 12 |
import os
|
| 13 |
from datetime import datetime, timedelta
|
| 14 |
+
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
def init_driver():
|
|
|
|
| 42 |
def access(driver,url):
|
| 43 |
print("_"*30, "ACCESS URL","_"*30)
|
| 44 |
driver.get(url)
|
| 45 |
+
sleep(15)
|
| 46 |
|
| 47 |
|
| 48 |
def search(driver, job, location):
|
| 49 |
print("_"*30, "SEARCH","_"*30)
|
| 50 |
|
| 51 |
+
search_box_job = driver.find_element(By.XPATH, '//input[@id="text-input-what"]')
|
|
|
|
|
|
|
|
|
|
| 52 |
search_box_location=driver.find_element(By.XPATH, '//input[@id="text-input-where"]')
|
| 53 |
search_box_job.send_keys(job)
|
| 54 |
search_box_location.send_keys(location)
|