Search code examples
pythonseleniumscreen-scraping

Selenium Get jsp generated Page Source


I have a website that populate its content using JSP.

I am trying to use Selenium to scrape the content there. When I opened up the page, I put a time sleep a few seconds and wait until the page fully loaded(I can see the data finished populating by eye-balling).

However, when I do browser.find_elements_by_class... I cannot find any element! I don't know how can I solve that issue in Selenium.


Solution

  • Check and see if your elements are inside of a frame or iframe.

    http://selenium-python.readthedocs.org/en/latest/navigating.html#moving-between-windows-and-frames documents the python version, which turns out to be:

     driver.switch_to_frame("framename")