主要思路
目的:
根據輸入的城市名,爬取該城市美團美食板塊所有商家的資料。資料報括:
並將這些資料存入excel中。
最後嘗試對爬取到的資料做乙個簡單的分析。
克服反爬蟲:
每頁使用不同的cookie值。
具體原理:
詳細的實現過程見源**。
開發工具
**python版本:**3.5.4
requests模組;
win_unicode_console模組;
openpyxl模組;
以及一些python自帶的模組。
環境搭建
安裝python並新增到環境變數,pip安裝需要的相關模組即可。
相關檔案
新手學習,python 教程/工具/方法/解疑+v:itz992
使用演示在cmd視窗執行mt_cate_spider.py檔案即可。
簡單分析
利用excel的資料分析功能簡單分析
用的上海地區的資料。
首先當然是按照評分排個序,然後做成柱狀圖:
然後再做點其他有趣的圖案:
php phpquery簡易爬蟲抓取京東商品分類
phpquery教程可在這裡檢視 2 抓取程式 created on 2015 1 29 to change the template for this generated file go to window preferences phpeclipse php code templates hea...
php phpquery簡易爬蟲抓取京東商品分類
phpquery教程可在這裡檢視 2 抓取程式 created on 2015 1 29 to change the template for this generated file go to window preferences phpeclipse php code templates hea...
php phpquery簡易爬蟲抓取京東商品分類
phpquery教程可在這裡檢視 2 抓取程式 created on 2015 1 29 to change the template for this generated file go to window preferences phpeclipse php code templates hea...