我正在深入研究Python,并且正在浏览urllib3的文档。尝试运行代码,但似乎没有按预期的方式运行。 我的代码是
import urllib3
t = urllib3.PoolManager
test = t.request('GET', 'https://shadowhosting.net/')
print(test.data)
我得到的错误是
TypeError: request() missing 1 required positional argument: 'url'
我试着换个地方,但还是不起作用。我将遵循文档(用户指南)的开头部分 供参考-https://urllib3.readthedocs.io/en/latest/user-guide.html
位于https://urllib3.readthedocs.io/en/latest/user-guide.html的文件说:
或在邮寄要求的情况下
这是一个输入错误,忘记了创建对象的括号:
添加它们,它将像魔术一样工作:
如果您想对URL发出
GET
请求,那么可以使用requests
模块相关问题 更多 >
编程相关推荐