BeautifulSoup, where are you putting my HTML?

后端 未结 1 1825
我在风中等你
我在风中等你 2020-12-12 01:34

I\'m using BS4 with python2.7. Here\'s the start of my code (Thanks root):

from bs4 import BeautifulSoup
import urllib2

f=urllib2.urlopen(\'http://yify-torr         


        
1条回答
  •  既然无缘
    2020-12-12 02:41

    I had the same problem and this solved my problem:

    soup = BeautifulSoup(html, 'html5lib')
    

    You need to install html5lib:

    pip install html5lib
    

    or

    easy_install html5lib
    

    You can read more about different parsers (pros and cons) for Beautiful Soup here:

    http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser

    0 讨论(0)
提交回复
热议问题