构造dom树的简单html解析器。
pyHTMLParser的Python项目详细描述
它旨在提供类似jquery的api。
示例
frompyHTMLParser.QueryimportQ_open,Q_close,QQ_open('http://www.example.com')second_target_link=Q('a[href$="-target.html"]:nth-child(2)')print(second_target_link.attr('href'))>>>http://www.some-target.com/example.htmlQ_close()