r/pythonhelp • u/Standard-Affect • Oct 16 '20
Selenium returning element not found error for for find_element_by_xpath
Hey all,
I'm new to Python, and I'm trying to use Selenium to automate downloading. My intention is to click the download button on this website (or the equivalent for different datasets). I've tried various methods of selecting the element, but none work. Currently I'm using the xpath, copied from Firefox's inspector. The path syntax appears valid (finding by id and using the * to search all xpaths), so I don't know what's causing the issue. Since other methods don't work either, I suspect I'm making some basic error using the driver.
Code:
browser.get("https://data.census.gov/cedsci/table?q=ACSDT1Y2018&tid=ACSDT1Y2018.B00001&tp=true&hidePreview=true")
browser.find_element_by_xpath('//*[@id="toolbar-download"]').click()Any suggestions?


