利用scrapy爬取大众点评数据
首先利用账号登陆获取cookie,然后构造请求参数 搜索关键词得到店铺名称,根据对应链接爬取店铺的 星级,评分,地址,电话等
大众点评是文字加密的,许多数字与汉字需要破解密码 其对应密码是该标签的class值, 在css文件中存放着 class值对应的background 位置信息 在以下链接中存放文字 http://s3plus.meituan.net/v1/mss_0a06a471f9514fc79c981b5466f56b91/svgtextcss/ac09bd813a3a57b29cb303da390fd501.svg 可以通过对比属性的x,y获取到具体的文字 (解码思路,具体函数在decode_str.py中)
并且由于爬取过程中会频繁被302重定向到验证码页面,所以在爬取过程中是在浏览器偶尔点击链接更新会话状态 ,保持爬取顺利
目前的版本由于是采用的规定的svg文件,所以也有些文字没有抓取下来,可以之后修改成每个页面中css相对应的svg文件解码