python3.6通过urlopen打开一个以html结尾的网址,再转换成BeautifulSoup打印这个对象为空为什么?
迷茫
迷茫 2017-04-18 10:22:48
0
3
645
htmlobj = urlopen('http://www.58pic.com/haibao/0/dnum-1.html')
soup = BeautifulSoup(htmlobj, "lxml")
print(soup)
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(3)
小葫芦

Please compare the codes

小葫芦

You should be like this

htmlobj = urlopen('http://www.58pic.com/haibao/0/dnum-1.html')
soup = BeautifulSoup(htmlobj.read(), "lxml")
print(soup)
伊谢尔伦

ubuntu 16.04, python3.5
The original code can be output and is not empty

If urlopen does return null, the usual error is that the server does not exist.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!