如何让 python 获取 HTTP 页面的内容?到目前为止,我只有请求,并且已经导入了 http.client。
最佳答案
使用 urllib.request
可能是最简单的方法:
import urllib.request
f = urllib.request.urlopen("http://stackoverflow.com")
print(f.read())
关于Python 3 获取 HTTP 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2023893/