import httplib
conn = httplib.HTTPConnection("www.baidu.com");
conn.request("GET", "/index.html");
r1 = conn.getresponse();
print r1.status, r1.reason;
print("\n"+r1.read());
conn.close();
python_获取网页的内容和状态
最新推荐文章于 2020-12-08 11:28:38 发布