用 Gitlab 或其他平台搭建好代码仓库;
在 Jenkins 中创建一个项目,在项目中将代码源指向之前创建的仓库;
在 Jenkins 项目中编写工作流,将发布地址指向 Crawlab 的CRAWLAB_SPIDER_PATH,如果是 Docker 注意将该地址挂载到宿主机文件系统;
Jenkins 项目的工作可以直接编写,也可以用 Jenkinsfile,具体可以查相关资料;
这样,每一次代码更新提交到代码仓库后,Jenkins 就会将更新后的代码发布到 Crawlab 里,Crawlab 主节点会将爬虫代码同步到工作节点,以待抓取。
在 Jenkins 中创建一个项目,在项目中将代码源指向之前创建的仓库;
在 Jenkins 项目中编写工作流,将发布地址指向 Crawlab 的CRAWLAB_SPIDER_PATH,如果是 Docker 注意将该地址挂载到宿主机文件系统;
Jenkins 项目的工作可以直接编写,也可以用 Jenkinsfile,具体可以查相关资料;
这样,每一次代码更新提交到代码仓库后,Jenkins 就会将更新后的代码发布到 Crawlab 里,Crawlab 主节点会将爬虫代码同步到工作节点,以待抓取。
通过接口的方法返回的,但是老接口还能用 https://m.weibo.cn/api/comments/show?id={id}&page={page} , 这里的id只是某条微博的id, page 是分页参数。
于是尝试用这个接口去获取数据
于是尝试用这个接口去获取数据
还有一个新接口,https://m.weibo.cn/comments/hotflow?mid=4477013081328252&max_id=330569188932643&max_id_type=0
这个接口也能拿到评论,mid 是某条微博的参数, max_id 是分页参数,这个参数可以从一个请求返回的数据中拿到
这个接口也能拿到评论,mid 是某条微博的参数, max_id 是分页参数,这个参数可以从一个请求返回的数据中拿到
使用Python3编写
Python3 is used
爬虫框架为Scrapy并且实际用到了Scrapy的诸多特性,是深入学习Scrapy的不错开源项目
Made full use of scrapy, if you are struggling with scrapy this repo helps to spark
利用Flask、Flask-socketio、Vue实现了高可用性的UI界面。功能强大实用,是新媒体运营等岗位不错的数据助手
Flask、Flask-socketio、Vue are used to build a full stack project crawler
得益于Scrapy、MongoDB、Elasticsearch的使用,数据爬取、存储、索引均简单高效
Thanks to scrapy mongodb elasticsearch weixin_crawler is not only a crawler but also a search engine
支持微信公众号的全部历史发文爬取
Able to crawl all the history articles of any weixin official account
支持微信公众号文章的阅读量、点赞量、赞赏量、评论量等数据的爬取
Python3 is used
爬虫框架为Scrapy并且实际用到了Scrapy的诸多特性,是深入学习Scrapy的不错开源项目
Made full use of scrapy, if you are struggling with scrapy this repo helps to spark
利用Flask、Flask-socketio、Vue实现了高可用性的UI界面。功能强大实用,是新媒体运营等岗位不错的数据助手
Flask、Flask-socketio、Vue are used to build a full stack project crawler
得益于Scrapy、MongoDB、Elasticsearch的使用,数据爬取、存储、索引均简单高效
Thanks to scrapy mongodb elasticsearch weixin_crawler is not only a crawler but also a search engine
支持微信公众号的全部历史发文爬取
Able to crawl all the history articles of any weixin official account
支持微信公众号文章的阅读量、点赞量、赞赏量、评论量等数据的爬取
weixin_crawler已经在Win/Mac/Linux系统下运行成功, 建议优先使用win系统尝试
weixin_crawler could work on win/mac/linux, although it is suggested to try on win os firstly
Insatall mongodb / redis / elasticsearch and run them in the background
downlaod mongodb / redis / elasticsearch from their official sites and install them
run them at the same time under the default configuration. In this case mongodb is localhost:27017 redis is localhost:6379(or you have to config in weixin_crawler/project/configs/auth.py)
Inorder to tokenize Chinese, elasticsearch-analysis-ik have to be installed for Elasticsearch
weixin_crawler could work on win/mac/linux, although it is suggested to try on win os firstly
Insatall mongodb / redis / elasticsearch and run them in the background
downlaod mongodb / redis / elasticsearch from their official sites and install them
run them at the same time under the default configuration. In this case mongodb is localhost:27017 redis is localhost:6379(or you have to config in weixin_crawler/project/configs/auth.py)
Inorder to tokenize Chinese, elasticsearch-analysis-ik have to be installed for Elasticsearch
#请进入相应的安装界面进行操作
宝塔面板:https://www.bt.cn/bbs/thread-1186-1-1.html
OneinStack:https://oneinstack.com/auto
LNMP:https://lnmp.org/install.html
宝塔面板:https://www.bt.cn/bbs/thread-1186-1-1.html
OneinStack:https://oneinstack.com/auto
LNMP:https://lnmp.org/install.html
www.bt.cn
宝塔Linux面板 - 7月4日更新 - 5.9免费版 - Linux面板 - 宝塔面板论坛
运维人员常用的服务器监控系统,宝塔面板可一键部署:LAMP/LNMP/Tomcat/Node.js环境,通过web端可视化操作,优化了建站流程,提供安全管理、计划任务、文件管理以及软件管理等功能,安装要求:Python版本: 2.6/2.7(安装宝塔时会自动安装)内存:128M以上,推荐512M以上(纯面板约占系统10M内存)硬盘:100M以上可用硬盘空间(纯面板约占20M磁盘空间 ... 宝塔Linux面板 - 7月4日更新 - 5.9免费版 ,宝塔面板论坛
1.选取种子URL; 2.将这些URL放入待抓取URL队列; 3.从待抓取URL队列中取出待抓取在URL。解析DNS,而且得到主机的ip,并将URL相应的网页下载下来,存储进已下载网页库中。 4.分析已抓取URL队列中的URL,分析当中的其它URL,而且将URL放入待抓取URL队列,从而进入下一个循环。
数据采集、数据存储、动态网页爬取、APP爬取、验证码破解、模拟登陆、代理试用、爬虫框架、分布式爬取等等。 目前主流的网络爬虫工具是python,涉及的库和工具: 网页爬取:urlib、requests、aiohttp、Selenium、Splash 网页解析:re、lxml、Beautiful Soup、pyquest 数据存储:JSON、XML、CSV、MySQL、MongoDB、Redis Web组件:Flask、Tornado 处理反爬:Tesserocr、ADSLProxy、ProxyPool、PookiesPool APP爬取:Charles、mitmproxy、mitmdump、Appium 爬虫框架:pyspider、Scrapy、Scrapy-Redis、Scrapy-Splash 管理部署:Docker、Scrapyd、Scrapyd-API、Scrapyd-Client、Gerapy