Close Button, getElementById, overlay
Posted on 2012-09-10
I have a screen scraper app. I'm scraping a page that has an overlay - it's that object that makes it look a modal popup, but actually is not. Now, there are elements within the overlay that I extract data from. These elements all have ID values. Now, the overlay has a "Close" button. I want to click the close button. The button does not have an ID, so I'm attempting to find it my looping through all the DOM elements and picking off the buttons, by class name, and then examining the text on the button. However, my loop through all the DOM elements never finds this button that is located within the overlay. There are other buttons on the page that are not within the overlay, and I do find these within the loop.
Any thoughts on why I cannot find the button within the overlay?