Giter VIP home page Giter VIP logo

paper's Introduction

Paper

文件说明

spider/
	/crawlLagou.py  使用selenium驱动浏览器内核爬取,返回json数据
	/localData.py   本地浏览器内核地址
	/store.py       爬取数据存储到mongodb中

preprocess/models/
	/db.js         数据库连接
	/schema.js     生成爬取原生数据对象模型,提供对数据库的操作
	/des.js        生成分析处理对象模型,提供对数据库操作,用于创业领域归类
	/insertTag.js  对创业领域数据集合初始化
	/lagouApp.js   读取爬虫爬取到的数据,按创业领域进行归类

data/
	/docx.txt   x代表数字,该领域所有公司介绍文字内容
	/x.txt      该领域分词去停用词结果

model/x/      x表示数字
	final.twords   主题模型结果
	

数字编号对应创业领域:
	1  移动互联网
	2  电子商务
	3  金融
	4  企业服务
	5  教育
	6  文化娱乐
	7  游戏
	8  O2O
	9  硬件
	10 医疗健康
	11 生活服务
	12 广告营销
	13 旅游
	14 数据服务
	15 社交网络
	16 分类信息
	17 信息安全
	18 招聘
	19 其他

MongoDB

  • 启动MongoDB
cd到mongo安装文件夹的bin目录下
mongod.exe --dbpath D:\software\mongo
用--dbpath指定数据存放地点为mongo文件夹
  • 连接MongoDB
cd到bin目录下
mongo

爬取动态网页

  • 静态爬虫借助python中的urllib和beautifulsoup很容易实现
  • 抓包分析:NetWork中获取json请求地址,抓取速度快
  • 驱动浏览器内核:占用资源多,慢
  • 动态爬虫工具(调用浏览器内核解析页面):
    1. selenium + webdriver 有界面浏览器
    2. headless phantomjs 速度比前者快

IP被封,解决办法:

  • 降低爬取频率
  • 更换user-Agent,模拟不同浏览器
  • 使用高匿代理,隐藏客户真实ip
  • ip解封后用phantomjs就拿不到json数据了,所以改用selenium去驱动真实浏览器渲染页面然后再去爬取

Reference

Pyspider获取json数据

Pyspider + PhantomJS渲染动态页面

MongoDB:NoSQL

可视化工具Robomongo

PyMongo:python操作MongoDB的模块

Wappalyzer: 分析网站使用了哪些技术和工具

LDA 文本分析 实验样例

LDA代码:代码一代码二

Selenium 中文文档

BeautifulSoup 中文文档

paper's People

Contributors

kad0108 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.