Read()的URL行为异常

时间:2018-07-07 15:45:07

标签: python python-3.x

我无法弄清楚为什么某些网站在运行代码时不会返回结果。在其他网站上运行代码就可以了。

https://www.singinglibrarianbooks.com/不断返回:“ b'... DOCTYPE html> ...

http://www.retailcomic.com/不断返回:b''

from urllib.request import urlopen

page_url = 'http://www.retailcomic.com/'
# page_url = 'https://www.singinglibrarianbooks.com/'

response = urlopen(page_url)

html_bytes = response.read()

print(html_bytes)

0 个答案:

没有答案