Python+Selenium Scrape Error: ElementNotVisibleException

east

I'm currently trying to use Selenium/Python/PhantomJS to scrape the results of the form below:

http://gis.vgsi.com/newhavenct/Sales.aspx

It looks like when I try to click on the search button, I get an ElementNotVisibleException error.

My code:

self.driver.find_element_by_id("MainContent_btnSearch").click()

After some digging online, it seems like the button may be hidden. Indeed, here is the relevant HTML code from the search page:

<input type="button" value="Search!" class="btn btn-primary searchTrigger" style="width: 200px;" />
<input type="submit" name="ctl00$MainContent$btnSearch" value="Search" id="MainContent_btnSearch" style="width: 200px; display: none;" />
<div id="MainContent_ctl00" style="display:none;">
</div>

I tried preceding my previous code with a click of the searchTrigger, but this is still not working:

self.driver.find_element_by_class_name("searchTrigger").click()
self.driver.find_element_by_id("MainContent_btnSearch").click()

Any advice would be greatly appreciated!

Andersson

Requested element has attribute style="display:none;", so you need to make it visible

Try to use following code:

self.driver.execute_script('document.getElementById("MainContent_btnSearch").style.display="block";')
self.driver.find_element_by_id("MainContent_btnSearch").click()

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Python Selenium - ElementNotVisibleException

From Dev

ElementNotVisibleException Python/Selenium error for next page button click

From Dev

Python and Selenium To “execute_script” to solve “ElementNotVisibleException”

From Dev

Python Selenium Screen Scrape

From Dev

ElementNotVisibleException: Message: Element is not currently visible... selenium (python)

From Dev

Selenium with Python: First instance of the element is identified but the next occurance is ElementNotVisibleException

From Dev

Selenium ElementNotVisibleException for Bootstrap Popover

From Dev

Selenium - Login raises ElementNotVisibleException

From Dev

Selenium ElementNotVisibleException for Bootstrap Popover

From Dev

Frustrating ElementNotVisibleException error

From Dev

Python and Selenium - Scrape data from multiple siblings

From Dev

How to scrape urls on a paginated site with Selenium / Python

From Dev

Click on show more button; selenium scrape with python

From Dev

How to scrape the value between > and < using selenium in Python?

From Dev

Using Python, Selenium, and BeautifulSoup to scrape for content of a tag?

From Dev

How to scrape the Glassdoor Rating using Selenium and Python

From Dev

ElementNotVisibleException in Selenium for a calender date input

From Dev

Selenium Webdriver Multiselect Dropdown ElementNotVisibleException

From Dev

How to fix Selenium Webdriver exception ElementNotVisibleException?

From Dev

Need to scrape a table which is loaded through ajax using python(selenium)

From Dev

Scrape a lightbox overlay using Selenium, Beautiful Soup in Python

From Dev

Selenium webdriver with python to scrape dynamic page cannot find element

From Dev

Scrape heading of a video using selenium python3

From Dev

How to scrape a Table with Selenium and Python 3.6 on windows 10

From Dev

Python Selenium import error

From Dev

ElementNotVisibleException when Selenium WebDriver isn't full screen

From Dev

Getting ElementNotVisibleException : Using Selenium WebDriver in MakeMyTrip.com for Date Picker

From Dev

Selenium ElementNotVisibleException when enclosing div has transform applied

From Dev

How to scrape dynamic content with Selenium?

Related Related

  1. 1

    Python Selenium - ElementNotVisibleException

  2. 2

    ElementNotVisibleException Python/Selenium error for next page button click

  3. 3

    Python and Selenium To “execute_script” to solve “ElementNotVisibleException”

  4. 4

    Python Selenium Screen Scrape

  5. 5

    ElementNotVisibleException: Message: Element is not currently visible... selenium (python)

  6. 6

    Selenium with Python: First instance of the element is identified but the next occurance is ElementNotVisibleException

  7. 7

    Selenium ElementNotVisibleException for Bootstrap Popover

  8. 8

    Selenium - Login raises ElementNotVisibleException

  9. 9

    Selenium ElementNotVisibleException for Bootstrap Popover

  10. 10

    Frustrating ElementNotVisibleException error

  11. 11

    Python and Selenium - Scrape data from multiple siblings

  12. 12

    How to scrape urls on a paginated site with Selenium / Python

  13. 13

    Click on show more button; selenium scrape with python

  14. 14

    How to scrape the value between > and < using selenium in Python?

  15. 15

    Using Python, Selenium, and BeautifulSoup to scrape for content of a tag?

  16. 16

    How to scrape the Glassdoor Rating using Selenium and Python

  17. 17

    ElementNotVisibleException in Selenium for a calender date input

  18. 18

    Selenium Webdriver Multiselect Dropdown ElementNotVisibleException

  19. 19

    How to fix Selenium Webdriver exception ElementNotVisibleException?

  20. 20

    Need to scrape a table which is loaded through ajax using python(selenium)

  21. 21

    Scrape a lightbox overlay using Selenium, Beautiful Soup in Python

  22. 22

    Selenium webdriver with python to scrape dynamic page cannot find element

  23. 23

    Scrape heading of a video using selenium python3

  24. 24

    How to scrape a Table with Selenium and Python 3.6 on windows 10

  25. 25

    Python Selenium import error

  26. 26

    ElementNotVisibleException when Selenium WebDriver isn't full screen

  27. 27

    Getting ElementNotVisibleException : Using Selenium WebDriver in MakeMyTrip.com for Date Picker

  28. 28

    Selenium ElementNotVisibleException when enclosing div has transform applied

  29. 29

    How to scrape dynamic content with Selenium?

HotTag

Archive