pyHTMLParser

A simple html parser that constructs DOM tree.


Keywords
parse
License
MIT
Install
pip install pyHTMLParser==2.1.0

Documentation

pyHTMLParser

HTML parser

Usage

from pyHTMLParser.Query import Q_open, Q_close, Q

Q_open('example.com')

second_target_link = Q('a[href$="-target.html"]:nth-child(2)')
print(second_target_link.attr('href'))

>>> some-target.html

Q_close()

Documentation

API Docs

LICENSE

MIT