8 百度360搜索关键词提交
"""百度搜索关键词提交""" import requests url = "https://www.baidu.com/s" keyword = "Python" try: kv = {‘wd‘: ‘keyword‘} r = requests.get(url, params=kv) # https://www.baidu.com/s?wd=Python print(r.request.url) r.raise_for_status() # 1469 r.encoding = r.apparent_encoding print(len(r.text)) # print(r.text) except: print("爬取失败")
"""百度360搜索关键词提交""" import requests url = "https://www.so.com/s" keyword = "Python" try: kv = {‘q‘: ‘keyword‘} r = requests.get(url, params=kv) # https://www.so.com/s?q=keyword print(r.request.url) r.raise_for_status() r.encoding = r.apparent_encoding print(len(r.text)) # 330288 print(r.text[:1000]) except: print("爬取失败")
相关推荐
zmosquito 2020-02-15
linqiang 2013-06-29
zhangpan 2020-09-10
LoveJob 2014-08-21
zmosquito 2016-03-02
lovecloudpan 2016-03-01
chenlaoyang 2014-12-24
lovecloudpan 2014-04-07
luyun0 2014-01-05
小白的黑科技 2016-10-20
nextwhy 2016-02-28
jtguve 2017-03-29
MrAnroidBeginner 2013-06-30
zhangjie 2018-10-07
lispython 2019-04-06