tornado.httpclient.HTTPClient()的用法

转载自:

使用tornado的httpclient模拟客户端

但是链接中的代码最早是2014年的,所以2020年已经失效了。

下面是python3.6下面跑通的版本:

import tornado.httpclient
http_client = tornado.httpclient.HTTPClient()
response = http_client.fetch("http://www.baidu.com")
print(response.body)
http_client.close()
发布了824 篇原创文章 · 获赞 394 · 访问量 175万+

猜你喜欢

转载自blog.csdn.net/appleyuchi/article/details/105398132