开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜