必应首页背景图片抓包-截取api

版权声明:虽然本文为博主原创文章,不过随便转载,但必须留下出处。 https://blog.csdn.net/Fighting_Dreamer/article/details/76518721

抓取必应图片的方法,
作用你可以自己考虑啊。
例如给你的app每天换一个背景,或者给你的桌面换背景
毕竟,必应找的图的质量还是可以保证的。

1.下面是获取图片网址的API

http://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&nc=1501558320736&pid=hp

2.下面是返回的数据

{"images":[{"startdate":"20170731","fullstartdate":"201707311600","enddate":"20170801","url":"/az/hprichbg/rb/Nyala_ZH-CN13349334824_1920x1080.jpg","urlbase":"/az/hprichbg/rb/Nyala_ZH-CN13349334824","copyright":"克鲁格国家公园内的雌性安氏林羚,南非 (© Richard Du Toit/Minden Pictures)","copyrightlink":"/search?q=%e5%ae%89%e6%b0%8f%e6%9e%97%e7%be%9a&form=hpcapt&mkt=zh-cn","quiz":"/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20170731_Nyala%22&FORM=HPQUIZ","wp":true,"hsh":"e237228a63e0266666a57d2c9d950109","drk":1,"top":1,"bot":1,"hs":[]}],"tooltips":{"loading":"Loading...","previous":"Previous image","next":"Next image","walle":"This image is not available to download as wallpaper.","walls":"Download this image. Use of this image is restricted to wallpaper only."}}

3.根据返回的数据就可以拼接出背景图像的网址

http://cn.bing.com/az/hprichbg/rb/Nyala_ZH-CN13349334824_1920x1080.jpg

这就是我们获取到的图像

4.修改n的值可以获取多个图像,不过最多只能得到几个。

http://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=22&nc=1501558320736&pid=hp

返回的结果

{"images":[{"startdate":"20170731","fullstartdate":"201707311600","enddate":"20170801","url":"/az/hprichbg/rb/Nyala_ZH-CN13349334824_1920x1080.jpg","urlbase":"/az/hprichbg/rb/Nyala_ZH-CN13349334824","copyright":"克鲁格国家公园内的雌性安氏林羚,南非 (© Richard Du Toit/Minden Pictures)","copyrightlink":"/search?q=%e5%ae%89%e6%b0%8f%e6%9e%97%e7%be%9a&form=hpcapt&mkt=zh-cn","quiz":"/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20170731_Nyala%22&FORM=HPQUIZ","wp":true,"hsh":"e237228a63e0266666a57d2c9d950109","drk":1,"top":1,"bot":1,"hs":[]},{"startdate":"20170730","fullstartdate":"201707301600","enddate":"20170731","url":"/az/hprichbg/rb/Mellieha_ZH-CN10970369201_1920x1080.jpg","urlbase":"/az/hprichbg/rb/Mellieha_ZH-CN10970369201","copyright":"梅利哈俯视视图,马耳他 (© Zoltan Gabor/Alamy)","copyrightlink":"/search?q=Mellie%c4%a7a&form=hpcapt&mkt=zh-cn","quiz":"/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20170730_Mellieha%22&FORM=HPQUIZ","wp":true,"hsh":"fa30e98d380192426977789e46db27b6","drk":1,"top":1,"bot":1,"hs":[]},{"startdate":"20170729","fullstartdate":"201707291600","enddate":"20170730","url":"/az/hprichbg/rb/MineralCliffs_ZH-CN11986913181_1920x1080.jpg","urlbase":"/az/hprichbg/rb/MineralCliffs_ZH-CN11986913181","copyright":"画岩湖滨,美国密歇根州 (© Steve Gettle/Minden Pictures)","copyrightlink":"/search?q=%e7%94%bb%e5%b2%a9%e6%b9%96%e6%bb%a8&form=hpcapt&mkt=zh-cn","quiz":"/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20170729_MineralCliffs%22&FORM=HPQUIZ","wp":true,"hsh":"ef25cb5c669cda5fedfec4ffe4d59e4f","drk":1,"top":1,"bot":1,"hs":[]},{"startdate":"20170728","fullstartdate":"201707281600","enddate":"20170729","url":"/az/hprichbg/rb/WaSqPk_ZH-CN9988391968_1920x1080.jpg","urlbase":"/az/hprichbg/rb/WaSqPk_ZH-CN9988391968","copyright":"华盛顿广场公园鸟瞰图,美国纽约 (© New York on Air/Offset)","copyrightlink":"/search?q=%e5%8d%8e%e7%9b%9b%e9%a1%bf%e5%b9%bf%e5%9c%ba%e5%85%ac%e5%9b%ad&form=hpcapt&mkt=zh-cn","quiz":"/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20170728_WaSqPk%22&FORM=HPQUIZ","wp":false,"hsh":"56c3a6fcef27ca12ba7c559d54fb986f","drk":1,"top":1,"bot":1,"hs":[]},{"startdate":"20170727","fullstartdate":"201707271600","enddate":"20170728","url":"/az/hprichbg/rb/TempleStreet_ZH-CN7471755280_1920x1080.jpg","urlbase":"/az/hprichbg/rb/TempleStreet_ZH-CN7471755280","copyright":"香港油麻地庙街夜市 (© Peter Stewart/500px)","copyrightlink":"/search?q=%e5%ba%99%e8%a1%97%e5%a4%9c%e5%b8%82&form=hpcapt&mkt=zh-cn","quiz":"/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20170727_TempleStreet%22&FORM=HPQUIZ","wp":true,"hsh":"c938ba8a09fc7c9d9232891eef4d5794","drk":1,"top":1,"bot":1,"hs":[]},{"startdate":"20170726","fullstartdate":"201707261600","enddate":"20170727","url":"/az/hprichbg/rb/HuangshanClouds_ZH-CN11669699321_1920x1080.jpg","urlbase":"/az/hprichbg/rb/HuangshanClouds_ZH-CN11669699321","copyright":"黄山,中国安徽省 (© Oktay Ortakcioglu/Getty Images)","copyrightlink":"/search?q=%e9%bb%84%e5%b1%b1&form=hpcapt&mkt=zh-cn","quiz":"/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20170726_HuangshanClouds%22&FORM=HPQUIZ","wp":true,"hsh":"ac54af19ad5a3614419b7b6e613b07b5","drk":1,"top":1,"bot":1,"hs":[]},{"startdate":"20170725","fullstartdate":"201707251600","enddate":"20170726","url":"/az/hprichbg/rb/WilsonPeakWindow_ZH-CN10363033426_1920x1080.jpg","urlbase":"/az/hprichbg/rb/WilsonPeakWindow_ZH-CN10363033426","copyright":"从鬼城Alta看到的威尔逊峰,美国科罗拉多州 (© Grant Ordelheide/Tandem Stills + Motion)","copyrightlink":"/search?q=Wilson+Peak&form=hpcapt&mkt=zh-cn","quiz":"/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20170725_WilsonPeakWindow%22&FORM=HPQUIZ","wp":false,"hsh":"5287e909cbbb7cf8b7b71318c8f47ab6","drk":1,"top":1,"bot":1,"hs":[]},{"startdate":"20170724","fullstartdate":"201707241600","enddate":"20170725","url":"/az/hprichbg/rb/ReinebringenRidge_ZH-CN9518224182_1920x1080.jpg","urlbase":"/az/hprichbg/rb/ReinebringenRidge_ZH-CN9518224182","copyright":"莫斯克内斯岛雷讷村雷纳布林根山岭的景观,挪威 (© David Varga/Shutterstock)","copyrightlink":"/search?q=Reinebringen+ridge&form=hpcapt&mkt=zh-cn","quiz":"/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20170724_ReinebringenRidge%22&FORM=HPQUIZ","wp":false,"hsh":"b3dee25bbc74dd72e45952aef811479b","drk":1,"top":1,"bot":1,"hs":[]}],"tooltips":{"loading":"Loading...","previous":"Previous image","next":"Next image","walle":"This image is not available to download as wallpaper.","walls":"Download this image. Use of this image is restricted to wallpaper only."}}
展开阅读全文

没有更多推荐了,返回首页