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("爬取失败")
原文地址:https://www.cnblogs.com/wkfvawl/p/9495406.html
时间: 2024-10-02 08:36:34