Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.3k views
in Technique[技术] by (71.8m points)

python - Unable to click dropdown when using selenium

I am using selenium to help download files. I run into an issue where I cannot click on this dropdown menu. I have tried searching ID and xpath, but python is spitting out 'no such element' error.

XPATH below:

//*[@id="ReportViewerCtl_ctl05_ctl04_ctl00_ButtonImg"]

HTML:

<img id="ReportViewerCtl_ctl05_ctl04_ctl00_ButtonImg" src="/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;Version=11.0.3452.0&amp;Name=Microsoft.Reporting.WebForms.Icons.Export.gif" alt="Export drop down

Have tried:

driver.find_element_by_id("ReportViewerCtl_ctl05_ctl04_ctl00_ButtonImg").click() 
driver.find_element_by_xpath('//*[@id="ReportViewerCtl_ctl05_ctl04_ctl00_ButtonImg"]').click()

Thank you in advance for all of the help! Just getting started with python.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...