标签:keyword params requests www www. status param code text
1 import requests 2 keyword = "Python" 3 try: 4 kv = {‘wd‘:keyword} 5 r = requests.get("http://www.baidu.com/s",params=kv) 6 print(r.request.url) 7 r.raise_for_status() 8 print(len(r.text)) 9 except: 10 print("爬取失败")
Requests库入门——应用实例-百度、360搜索关键词提交
标签:keyword params requests www www. status param code text
原文地址:https://www.cnblogs.com/wkfvawl/p/9495406.html