malformed start tag error - Python, BeautifulSoup, and Sipie - Ubuntu 10.04

前端 未结 5 1899
再見小時候
再見小時候 2021-02-14 23:31

I just installed python, mplayer, beautifulsoup and sipie to run Sirius on my Ubuntu 10.04 machine. I followed some docs that seem straightforward, but am encountering some iss

5条回答
  •  孤独总比滥情好
    2021-02-15 00:08

    Suppose you are using BeautifulSoup4, I found out something in the official document about this: http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser

    If you’re using a version of Python 2 earlier than 2.7.3, or a version of Python 3 earlier than 3.2.2, it’s essential that you install lxml or html5lib–Python’s built-in HTML parser is just not very good in older versions.

    I tried this and it works well, just like what @Joshua

    soup = BeautifulSoup(r.text, 'html5lib')
    

提交回复
热议问题