HTML Parsing
Parse HTML within a response
Library
Time (1e5 trials)
>>> resp = session.get('https://python.org/')
>>> resp.html
<HTML url='https://www.python.org/'>Parsing page
>>> resp.html.links
{'//docs.python.org/3/tutorial/', '/about/apps/', 'https://github.com/python/pythondotorg/issues', '/accounts/login/', '/dev/peps/', '/about/legal/',...>>> resp.html.absolute_links
{'https://github.com/python/pythondotorg/issues', 'https://docs.python.org/3/tutorial/', 'https://www.python.org/about/success/', 'http://feedproxy.g...>>> resp.html.search('Python is a {} language')[0]
programmingSelecting elements
Introspecting elements
Last updated