Extracting contents from specific meta tags that are not closed using BeautifulSoup

前端 未结 6 1370
孤街浪徒
孤街浪徒 2020-12-28 09:34

I\'m trying to parse out content from specific meta tags. Here\'s the structure of the meta tags. The first two are closed with a backslash, but the rest don\'t have any clo

6条回答
  •  感动是毒
    2020-12-28 10:14

    soup3 = BeautifulSoup(page3, 'html5lib')
    

    xhtml requires the meta tag to be closed properly, html5 does not. The html5lib parser is more "permissive".

提交回复
热议问题