I am trying to scrape data from highchart. I took a look at similar questions, but didn't understand how script_execute works or how could I detect js using my browser. Here is my current code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
# Core settings
chrome_path = r"C:\Users\X\Y\chromedriver_win32\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)
driver.implicitly_wait(15)
stats_url = 'https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/statistics/'
driver.get(stats_url)
driver.find_element_by_link_text('by Source').click()
driver.find_element_by_id('custom-date-range').click()
year = driver.find_element_by_id('date-range-start')
year.click()
for i in range(5): # goes back 5 years
year.send_keys(Keys.ARROW_DOWN)
driver.find_element_by_id('date-range-submit').click()
I want to scrape the "download" data from the graph, (not only for this page for many pages though). And when I use custom search option, csv file that automatically generated by the website is not updated. So only way is to scrape the data from the graph. How I could do it ?
find_element_by_xpath('//*[@id="side-nav"]/ul/li[2]/a')becomesfind_element_by_partial_link_text("Downloads").find_element_by_id(). Use that instead.