抓取淘宝评论
来源:互联网 发布:阿里云怎么搭建vpn免流 编辑:程序博客网 时间:2024/06/11 19:48
import requestsheaders={ 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36' }'''url='https://rate.tmall.com/list_detail_rate.htm?itemId=529571326323\&spuId=524781228&sellerId=2484777365&order=3¤tPage=2&\append=0&content=1&tagId=&posi=&picture=&ua=098'res=requests.get(url,headers=headers)#print(res.text)''''''import jsonjd=json.loads(res.text.lstrip("\r\n\njsonp1510(").rstrip(")"))#print(jd)comment=jd['rateDetail']['rateCount']['total']#print(comment)a=jd['rateDetail']['rateList']#print(a)for b in a: c=b['appendComment'] print(c)'''import re'''for i in range(1,11): url='https://rate.tmall.com/list_detail_rate.htm?itemId=529571326323&spuId=524781228&sellerId=2484777365&order=3¤tPage={}&append=0&content=1&tagId=&posi=&picture=&ua=098'.format(str(i)) res=requests.get(url,headers=headers) pat='ontent":(.*?)","' com=re.findall(pat,res.text) for a in com: print(a)'''f=open('C:/Users/Administrator/Desktop/taobao_comments.txt','a+')for i in range(1,11): try: url='https://rate.tmall.com/list_detail_rate.htm?itemId=529571326323&spuId=524781228&sellerId=2484777365&order=3¤tPage={}&append=0&content=1&tagId=&posi=&picture=&ua=098'.format(str(i)) res=requests.get(url,headers=headers) pat='ontent":(.*?)","' com=re.findall(pat,res.text) for a in com: print(a) f.write(a) f.write('\n') except: print('爬取第'+str(i)+'页出现问题') continuef.close()
阅读全文
0 0
- 抓取淘宝评论
- 淘宝评论数据抓取简记
- 关于淘宝网评论数据的抓取
- python爬取ajax动态生成的数据 以抓取淘宝评论为例子
- 通过抓取淘宝评论为例讲解Python爬取ajax动态生成的数据
- python爬取ajax动态生成的数据 以抓取淘宝评论为例子
- php淘宝评论采集
- 淘宝评论爬虫python
- 抓取腾讯新闻评论
- 虎扑网评论基础抓取
- scrapy抓取淘宝女郎
- 淘宝抓取信息接口
- python 淘宝MM抓取
- 淘宝商品评论爬取
- 淘宝评论星星级别数目
- 抓取京东评论数据
- 【python 淘宝爬虫】淘宝信誉分抓取
- 抓取淘宝MM的照片
- leetcode 算法 17. Letter Combinations of a Phone Number
- js中数组的用法
- 长整数排序(指针专题)
- conv2、filter2、imfilter的区别
- MySQL的并集、差集
- 抓取淘宝评论
- 第三方短信验证
- 剑指Offer(一)二维数组中的查找
- 科学的解决Http Token拦截器实现【详细 一篇足矣】
- Jenkins 打包Unity APK
- Windows桌面应用程序(1-1-2-3rd) 使用着色器和着色器资源
- Nagios添加mysql监控
- MTK AT端口打开方法
- 机器学习&深度学习算法及代码实现