0

I'm new to python and want to write a web scraper which involves mouse clicking an "OK" button on a pop-up window.

Everything else went well but I'm not able to click the final button which leads to the data downloading.

The javascript is as follows:

enter image description here

I tried finding element by id but the following error message appeared:

enter image description here

2
  • 3
    You know, instead of using Screenshots of the code, use your previous version in which you had actually added the code. This will get you downvotes Commented Sep 6, 2016 at 7:55
  • @NSNoob. Cool it's my first time to post anything. thanks for the tip! Commented Sep 6, 2016 at 22:02

2 Answers 2

2

find_elements_by_id returns a list of elements. Either iterate over the list that find_elements_by_id returns or use find_element_by_id (notice the missing 's') which will return only a single element (if any).

Sign up to request clarification or add additional context in comments.

Comments

1

try this:

browser.find_element_by_id('ctl00_ContentContainer1_ctl00_ButtonsContent_ExportOptionsBottomButtons_OkLabel').click()

Changed this:

find_elements_by_id

to this:

find_element_by_id

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.