import requests
import time,json
file = open('mapbar.txt','w',encoding='utf-8')
def mapbar(keyword):
time_now = int(time.time() * 1000)
for pn in range(1,30):
parameter = {
'_': time_now,
's': 'json',
'pn': pn,
'rn': '10',
'c': '%E5%94%90%E5%B1%B1%E5%B8%82',
'k': keyword,
't': 's1.2'
}
url = 'http://www.mapbar.com/search/s?'
try:
res = requests.get(url=url, params=parameter)
res_json = json.loads(res.text)
for i in res_json['e']:
print(i['n'] + '\t' + i['d'])
except:
pass
if __name__ == '__main__':
keyword1 = '%E8%97%9D%E8%A1%93' #艺术
mapbar(keyword1)
图吧爬虫
最新推荐文章于 2021-09-08 21:12:17 发布