I'm using Python with Selenium. I discovered, perhaps poorly, that if I load driver.get(view-source:http://www.example.com)
through the Firefox driver, the site loads faster and also resolves some other issues I'm having. However, driver.page_source
is not loading the html is displayed. Instead, a sort of template is loaded that looks like:
<html webdriver="true">...
<spand id="line2">...
<spand id="line3">...
<spand id="line4">...
None of the page content is existent in this result. If it makes sense, the id tags then become encased in their own tags. For example, usually the page has the line
<Header id="NewsHeadline">Some text here</Header>
Now, the page looks like <spand id="line4"><header>id="Newsheadline"</header></span>
To make my question short, is there some way I can get the visible text (which happens to be the html) without using driver.page_source
? Thanks!