+ 2
How to get an HTML element text by id in Python
If i have this string: Html = '<html> <head> <title>Example title </title> </head> <body> <div class="container"> <h1 id="title">TITLE </h1> </div> </body>' I want to get the contwnt of the h1 with id "title" How??
2 Answers
+ 1
Python has a module called html.
If you run help("html") in Python, you'll get some information about it.
The document includes this link, which leads to python.org documentation about the library.
https://docs.python.org/3.6/library/html
+ 1
Maybe the module bs4 (Beautiful Soup) would be helpful there: https://www.crummy.com/software/BeautifulSoup/bs4/doc/