我正在尝试import urllib.parse
模块,唉,没有成功。
我在我的MacOS上安装了Python 2.7和3.6,这应该足够了,但是,在启动时python3 url.py
我收到此错误:
Traceback (most recent call last):
File "url.py", line 1, in <module>
import urllib.parse, urllib.request
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 88, in <module>
import http.client
ModuleNotFoundError: No module named 'http.client'; 'http' is not a package
url.py
import urllib.parse, urllib.request
# from bs4 import BeautifulSoup
fhand = urllib.request.urlopen("http://someurl.com")