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

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -