代码拉取完成,页面将自动刷新
同步操作将从 小码编程/scrapy_zhaopin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import json
import requests
head = {'host': 'h5api.m.taobao.com',
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36',
'cookie': 't=b1293b84b15857eef2477e87a2c463a4; cna=tOKCE20h/WUCAXPstbNVnaFO; thw=cn; hng=CN%7Czh-CN%7CCNY%7C156; ali_ab=115.236.181.179.1526621044801.8; UM_distinctid=1638b1d8284139-09ce3ff908074e-454c092b-100200-1638b1d828539a; enc=utUKtJXwxNlBRJ4MNZi0nHJ9Z3iS03Xf5QWZcqcUUE5s77naaF%2Bd8Cl4NUOgfTMx%2Bg7L1qoqP%2FuP9cLMhgDYsw%3D%3D; l=AoCAfQM8KXqm6kfoFAInkuak0ARSCWTT; tg=0; cookie2=5d92e5df49299d7fd4659924f7ce6d6f; _tb_token_=5e64e53e73e3e; _cc_=URm48syIZQ%3D%3D; _m_h5_tk=7cc83f4bcd396d26323a05517fa4fa06_1528955944928; _m_h5_tk_enc=99623c2228c43227d2df622832e9caa6; v=0; uc3=nk2=stHgFFcbILLr05o%3D&id2=UojXIdrCdOsGmA%3D%3D&vt3=F8dBzr2I9ePQa00tUIk%3D&lg2=W5iHLLyFOGW7aA%3D%3D; existShop=MTUyODk1NTgxNg%3D%3D; lgc=%5Cu8273%5Cu82731990316; tracknick=%5Cu8273%5Cu82731990316; dnk=%5Cu8273%5Cu82731990316; sg=648; csg=4aaa46b0; cookie1=BqfUOoKK6qHwVUDKIL8MKIrUGJ9Shhw64Z9DVnVmu1A%3D; unb=1939659924; skt=51082ed34042b2b3; _l_g_=Ug%3D%3D; _nk_=%5Cu8273%5Cu82731990316; cookie17=UojXIdrCdOsGmA%3D%3D; mt=ci=70_1; uc1=cookie16=WqG3DMC9UpAPBHGz5QBErFxlCA%3D%3D&cookie21=VFC%2FuZ9aiKCaj7AzMpJs&cookie15=UIHiLt3xD8xYTw%3D%3D&existShop=false&pas=0&cookie14=UoTeNmh59xE4kw%3D%3D&tag=10&lng=zh_CN; isg=BDMz0-1abPhy3SAX7bx5rOkbwjedwKO4LlO1XeXQntKJ5FOGbThXepFamhQKxB8i'}
url = 'http://h5api.m.taobao.com/h5/mtop.taobao.iliad.comment.query.latest/1.0/?jsv=2.4.0&appKey=12574478&t=1528956323325&sign=d98e195b3ca4e084b6b6debcb5bef43f&api=mtop.taobao.iliad.comment.query.latest&v=1.0&type=jsonp&dataType=jsonp&callback=mtopjsonp516&data=%7B%22limit%22%3A20%2C%22topic%22%3A%22b5d34611-cdda-4af2-8961-212765c4c149%22%2C%22tab%22%3A2%2C%22order%22%3A%22acs%22%2C%22paginationContext%22%3A%22%7B%5C%22commentId%5C%22%3A101962196188%2C%5C%22refreshTime%5C%22%3A1528956323300%2C%5C%22timestamp%5C%22%3A1528956321000%7D%22%2C%22from%22%3A%22zhongkong%22%7D'
jscontent = requests.get(url, headers=head).content
jsDict = json.loads(jscontent.decode('utf-8').strip(" mtopjsonp516()"))
jsData = jsDict['data']
# comments=jsData["commentid"]
# for each in comments:
# print (each['content'])
print(jscontent.decode('utf-8').strip(" mtopjsonp6318()"))
print(jsDict)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。