from lxml import etree
html_tree = etree.HTML(html string)
html_tree.xpath(’’) 参考:http://www.w3school.com.cn/xpath/xpath_syntax.asp
#xpath 和css selector基本可以互换
css selector 参考:http://www.w3school.com.cn/cssref/css_selectors.ASP
from lxml import etree
html_tree = etree.HTML(html string)
html_tree.xpath(’’) 参考:http://www.w3school.com.cn/xpath/xpath_syntax.asp
#xpath 和css selector基本可以互换
css selector 参考:http://www.w3school.com.cn/cssref/css_selectors.ASP