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

前端 未结 5 1911
再見小時候
再見小時候 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:14

    Command Line:

    $ pip install beautifulsoup4
    $ pip install html5lib
    

    Python 3:

    from bs4 import BeautifulSoup
    from urllib.request import urlopen
    
    url = 'http://www.example.com'
    page = urlopen(url)
    soup = BeautifulSoup(page.read(), 'html5lib')
    links = soup.findAll('a')
    
    for link in links:
        print(link.string, link['href'])
    

提交回复
热议问题