我正在遵循“Web Scraping with Python”一书中的练习,但在运行以下代码时出现“解析时意外 EOF”错误:
from urllib.request import urlopen
from urllib.error import HTTPError
try:
html = urlopen('http://www.pythonscraping.com/pages/page1.html')
except HTTPError as e:
print(e)
# return null, break, or do some other "Plan B"
else:
# program continues. Note: If you return or break in the
# exception catch, you do not need to use the "else" statement
关于可能导致它的任何线索?
提前致谢。