0

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!

Apriconer
  • 45
  • 3
  • Hi Kiril, that one uses a specific id, which would restrict the selection to my knowledge. I'd like to get the entire page. I'll try it using html as the selector. – Apriconer Jun 01 '16 at 20:56
  • 1
    No that answer uses the body tag ,which is the complete site content. – Mobrockers Jun 02 '16 at 06:29

0 Answers0