Update uk_scraper.py

updated with From and To date feature
This commit is contained in:
Tej Kedar
2021-05-07 23:37:19 +02:00
committed by GitHub
parent b4cee9c3c9
commit f6183d7ef7

View File

@@ -49,9 +49,12 @@ def get_all_link_urls():
WebDriverWait(driver, 10).until(ec.visibility_of_element_located((By.XPATH, '//div[contains(@class, "card-list")]'))) WebDriverWait(driver, 10).until(ec.visibility_of_element_located((By.XPATH, '//div[contains(@class, "card-list")]')))
#driver.find_element_by_xpath('//*[@id="FromDate"]').send_keys(DATE_FROM) driver.find_element_by_xpath('//*[@id="FromDate"]').clear()
#driver.find_element_by_xpath('//*[@id="ToDate"]').send_keys(DATE_TO) driver.find_element_by_xpath('//*[@id="ToDate"]').clear()
#driver.find_element_by_xpath('//*[@id="voteSearch"]/div[2]/div/div/div/button').click() driver.find_element_by_xpath('//*[@id="FromDate"]').send_keys(DATE_FROM)
driver.find_element_by_xpath('//*[@id="ToDate"]').send_keys(DATE_TO)
#time.sleep(WAIT_TIME_SEC)
driver.find_element_by_xpath('//button[@class="btn btn-primary"]').click()
running = True running = True
while running: while running:
@@ -115,4 +118,4 @@ for elem in title_link_list:
for file_url in title_csv_list: for file_url in title_csv_list:
save_to_file(file_url, DOWNLOAD_FOLDER) save_to_file(file_url, DOWNLOAD_FOLDER)
#print(file_url) #print(file_url)