(python) sgmlparser and how to extract data between tags, not attributes / values

Each example I see for sgmlparser includes searching for a tag and then searching for attributes / values ​​of the tag. So it will be an opportunity to extract "google.com". but I want data between tags. therefore, if I used sgmlparser, I would search and retrieve everything in this div before closing the tag. What does sgmlparser work, or am I using the wrong library?

+3
source share
1 answer

Since you mention a div, I'm going to parse your HTML. For this, your best choice is BeautifulSoup .

+1
source

Source: https://habr.com/ru/post/1729974/


All Articles