Extract data from Python locally html files -
i extract data several html files in folder (saved locally) , save information text file. html toolboxes in python seems deal online webpages , not locally saved files. example, if find "cas registry number" files , write text file how should do?
example of html row containg informtion:
<div class=detailtitle><span class=title>cas registry number</span> 555-34-0</div>
i suggest use pyquery, elegant handling html elements'
tutorial here
code :
from pyquery import pyquery html = open("index.html", 'r').read() # local html query = pyquery(html) query("li").eq(1).text() ......
Comments
Post a Comment