python中怎样调用百度搜索的API接口?
2个回答
广东轻亿云软件
2024-05-14 广告
2024-05-14 广告
广东轻亿云软件科技有限公司是一家数字化服务提供商,致力于专业的数据集成,数据运营,数据分析服务领域, 使繁杂数字化应用从此变得简单,易用,构建万物互联的数字化企业。目前我们已经为100+原厂软件提供了全场景的系统集成能力,为500+客户提供...
点击进入详情页
本回答由广东轻亿云软件提供
展开全部
百度api有很多接口,你是想调用什么接口呢?
# coding=utf-8
import requests
keyword = 'python'
url_search = "
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763'
,
'Cookie': 'H_PS_PSSID=30974_1427_31326_21092_31253_31423_31342_31270_1996_31228_30824_31164_31196; delPer=0; PSINO=6; BDRCVFR[SL8xzxBXZJn]=mk3SLVN4HKm; BAIDUID=92F2A6CAED4A8E797EF329C1BEA36AF0:FG=1; BIDUPSID=92F2A6CAED4A8E797EF329C1BEA36AF0; PSTM=1517023043; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; BD_HOME=1; BD_CK_SAM=1; H_PS_645EC=1d914DqBInyPzMSJ0BhiFxyUg23bH6JpxiRsTot0M6bB2pmhpTweczGUbAU; COOKIE_SESSION=1749_0_2_5_0_2_0_0_2_2_0_0_0_0_0_0_0_0_1587960538%7C5%230_0_1587960538%7C1; BD_UPN=1d314753'
}
res = requests.get(url_search,headers=headers)
print(res.content.decode())
# coding=utf-8
import requests
keyword = 'python'
url_search = "
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763'
,
'Cookie': 'H_PS_PSSID=30974_1427_31326_21092_31253_31423_31342_31270_1996_31228_30824_31164_31196; delPer=0; PSINO=6; BDRCVFR[SL8xzxBXZJn]=mk3SLVN4HKm; BAIDUID=92F2A6CAED4A8E797EF329C1BEA36AF0:FG=1; BIDUPSID=92F2A6CAED4A8E797EF329C1BEA36AF0; PSTM=1517023043; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; BD_HOME=1; BD_CK_SAM=1; H_PS_645EC=1d914DqBInyPzMSJ0BhiFxyUg23bH6JpxiRsTot0M6bB2pmhpTweczGUbAU; COOKIE_SESSION=1749_0_2_5_0_2_0_0_2_2_0_0_0_0_0_0_0_0_1587960538%7C5%230_0_1587960538%7C1; BD_UPN=1d314753'
}
res = requests.get(url_search,headers=headers)
print(res.content.decode())
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询