lxml.html.document_fromstring is different from origin html document
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
New
|
Undecided
|
Unassigned |
Bug Description
I use lxml parse html to document.But lxml document is difference from browser.
import requests
import lxml
url='http://
headers=
html_string=
doc = lxml.html.
xpath_result=
xpath_result is None
And other xpath has result
doc.xpath(
doc.xpath(
browser html like :
<div>
<h1>
<p>
</p>
</h1>
</div>
lxml html like:
<div>
<h1>
</h1>
<p>
</p>
</div>
May I ask what causes this.How to get ture document and use true xpath to parse html document.
Thanks.