AttributeError: module 'urllib' has no attribute 'request'
环境:python3.X
代码:
# coding:utf8
import urllib
from bs4 import BeautifulSoup
url = "http://www.baidu.com"
print("第一种方法:")
response1 = urllib.request.urlopen(url)
print(response1.getcode())
bs = BeautifulSoup(response1.read(), 'html.parser', from_encoding='utf8')
print(bs.find_all('a'))
eclipse 提示错误 AttributeError: module 'urllib' has no attribute 'request'
但是如果引入import http.cookiejar结果就正常。。。什么原因呢