开发者

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

开发者 https://www.devze.com 2022-12-17 07:41 出处:网络
Every example I see for sgmlparser involves finding a tag, then finding the attributes/values of the tag. So forit would be the ability to extract \'google.com\' out. but i want the data between tags.

Every example I see for sgmlparser involves finding a tag, then finding the attributes/values of the tag. So for it would be the ability to extract 'google.com' out. but i want the data between tags. so if i used sgmlparser, i would look for and extract out everything in t开发者_运维技巧hat div until it's closing tag. is that the job of sgmlparser, or am i using the wrong library?


Because you mention div's, I gather you want to parse HTML. For doing that your best choice is BeautifulSoup.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号