我订阅了近 100 个公众号,有时候想再找之前读过的文章,发现搜索起来特别困难,如果忘了收藏,估计得找半小时,更让人无语的是,文章已经发布者删除,或者文章因违规被删除。那么有没有这样的爬虫,可以将公众号的文章全部爬到本地,并提供便捷的搜索功能,这样当我想查找某类文章的时候会非常方便,同时文章都在本地,也不用担心被人删除。

最近正好看到一个牛逼的 Python 爬虫项目,就是爬取微信公众号的文章的,看了一下功能介绍,真是想见恨晚啊,作者水平真的是牛逼,我已经献出了自己的崇拜,特分享出来,你可以使用它的功能,也可以研究它的技术,请拿走不谢。访问项目地址,相信你完全有独立部署的能力。

项目地址:https://github.com/wonderfulsuccess/weixin_crawler

功能展示

UI主界面

分享一个牛逼的Python项目:公众号文章爬虫-1.jpg (1.34 MB, 下载次数: 0)

2020-9-9 13:19 上传

爬虫主界面.gif

添加公众号爬取任务和已经爬取的公众号列表

分享一个牛逼的Python项目:公众号文章爬虫-2.jpg (41.17 KB, 下载次数: 0)

2020-9-9 13:19 上传

公众号.png

爬虫界面

分享一个牛逼的Python项目:公众号文章爬虫-3.jpg (19.14 KB, 下载次数: 0)

2020-9-9 13:19 上传

设置界面

分享一个牛逼的Python项目:公众号文章爬虫-4.jpg (20.7 KB, 下载次数: 0)

2020-9-9 13:19 上传

设置.png

公众号历史文章列表

分享一个牛逼的Python项目:公众号文章爬虫-5.jpg (1.8 MB, 下载次数: 0)

2020-9-9 13:19 上传

历史文章列表.gif

报告

分享一个牛逼的Python项目:公众号文章爬虫-6.jpg (1.1 MB, 下载次数: 0)

2020-9-9 13:19 上传

报告.gif

搜索

分享一个牛逼的Python项目:公众号文章爬虫-7.jpg (1.61 MB, 下载次数: 0)

2020-9-9 13:19 上传

搜索.gif

简介

weixin_crawler是一款使用Scrapy、Flask、Echarts、Elasticsearch等实现的微信公众号文章爬虫,自带分析报告和全文检索功能,几百万的文档都能瞬间搜索。weixin_crawler设计的初衷是尽可能多、尽可能快地爬取微信公众的历史发文。

weixin_crawler 尚处于维护之中, 方案有效, 请放心尝试。

免部署马上体验公众号数据采集

通过免安装可执行程序WCplus.exe https://shimo.im/docs/E1IjqOy2cYkPRlZd 可马上体验weixin_crawler的数据采集功、导出Excel和PDF功能。

主要特点

使用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支持微信公众号文章的阅读量、点赞量、赞赏量、评论量等数据的爬取

Able to crawl the reading data自带面向单个公众号的数据分析报告

Released with report module based on sigle official account利用Elasticsearch实现了全文检索,支持多种搜索和模式和排序模式,针对搜索结果提供了趋势分析图表

It is also a search engine支持对公众号进行分组,可利用分组数据限定搜索范围

Able to group official account which can be used to define searching range原创手机自动化操作方法,可实现爬虫无人监管

Whith the help of adb, weixin_crawler is able to opereate Android phone automatically, which means it can work without any human monitoring支持多微信APP同时采集, 理论上采集速度可线性增加

Mutiple weixin app is supported to imporove crawling speed linearly

使用到的主要工具

语言 Python3.6 前端 web框架 Flask / Flask-socketio / gevent js/css库 Vue / Jquery / W3css / Echarts / Front-awsome 后端 爬虫 Scrapy 存储 Mongodb / Redis 索引 Elasticsearch

运行方法

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

Install proxy server and run proxy.js

install nodejs and then npm install anyproxy and redis in weixin_crawler/proxy

cd to weixin_crawler/proxy and run node proxy.js

install anyproxy https CA in both computer and phone side

if you are not sure how to use anyproxy, here is the doc

Install the needed python packages

NOTE: you may can not simply type pip install -r requirements.txt to install every package, twisted is one of them which is needed by scrapy. When you get some problems about installing python package(twisted for instance), here always have a solution——downlod the right version package to your drive and run $ pip install package_name

I am not sure if your python enviroment will throw other package not found error, just install any package that is needed

Some source code have to be modified(maybe it is not reasonable)

scrapy Python36\Lib\site-packages\scrapy\http\request\ _init_.py --> weixin_crawler\source_code\request\_init_.py

scrapy Python36\Lib\site-packages\scrapy\http\response\ _init_.py --> weixin_crawler\source_code\response\_init_.py

pyecharts Python36\Lib\site-packages\pyecharts\base.py --> weixin_crawler\source_code\base.py. In this case function get_echarts_options is added in line 106

If you want weixin_crawler work automatically those steps are necessary or you shoud operate the phone to get the request data that will be detected by Anyproxy manual

Install adb and add it to your path(windows for example)

install android emulator(NOX suggested) or plugin your phone and make sure you can operate them with abd from command line tools

If mutiple phone are connected to your computer you have to find out their adb ports which will be used to add crawler

adb does not support Chinese input, this is a bad news for weixin official account searching. In order to input Chinese, adb keyboard has to be installed in your android phone and set it as the default input method, more is here

Why could weixin_crawler work automatically? Here is the reason:

If you want to crawl a wechat official account, you have to search the account in you phone and click its "全部消息" then you will get a message list , if you roll down more lists will be loaded. Anyone of the messages in the list could be taped if you want to crawl this account's reading data If a nickname of a wechat official account is given, then wexin_crawler operate the wechat app installed in a phone, at the same time anyproxy is 'listening background'...Anyway weixin_crawler get all the request data requested by wechat app, then it is the show time for scrapy As you supposed, in order to let weixin_crawler operate wechat app we have to tell adb where to click swap and input, most of them are defined in weixin_crawler/project/phone_operate/config.py. BTW phone_operate is responsible for wechat operate just like human beings, its eyes are baidu OCR API and predefined location tap area, its fingers are adb Run the main.py

$ cd weixin_crawler/project/

$ python(3) ./main.py

Now open the browser and everything you want would be in localhost:5000.

In this long step list you may get stucked, join our community for help, tell us what you have done and what kind of error you have found.

Let's go to explore the world in localhost:5000 together

作者:somenzz

来源:简书

python 公众号文章发布_分享一个牛逼的Python项目:公众号文章爬虫相关推荐

  1. python爬取公众号阅读量_分享一个牛逼的Python项目:公众号文章爬虫

    我订阅了近 100 个公众号,有时候想再找之前读过的文章,发现搜索起来特别困难,如果忘了收藏,估计得找半小时,更让人无语的是,文章已经发布者删除,或者文章因违规被删除.那么有没有这样的爬虫,可以将公众 ...

  2. python点云快速配准_分享一个V-SLAM中点云配准算法改进的方法

    近年来,随着自主导航的广泛应用,视觉同时定位与地图构建(Visual simultaneous localization and mapping, V-SLAM)通过自身携带的视觉传感器对周围环境进行 ...

  3. 分享一个牛逼的 Java 开源后台管理系统,不要造轮子了!

    点击上方 好好学java ,选择 星标 公众号 重磅资讯.干货,第一时间送达 今日推荐:后端程序员必备:书写高质量SQL的30条建议个人原创+1博客:点击前往,查看更多 还是那句话,重复造轮子是个苦逼 ...

  4. 分享一个牛逼的阿里天猫面经,已经拿到 Offer ,来自朋友的朋友

    个人背景 本人毕业于杭州的一所二本学校,实习进入了传统企业,毕业的时候发现互联网不但薪资高,技术也新,自己在这个老旧的地方待着可能没啥前途,所以毕业两个月的时候就出去找工作了. 但是从传统企业到互联网 ...

  5. python image 转成字节_就是这么牛!三行Python代码,让数据处理速度提高2到6倍

    本文可以教你仅使用 3 行代码,大大加快数据预处理的速度. Python 是机器学习领域内的首选编程语言,它易于使用,也有很多出色的库来帮助你更快处理数据.但当我们面临大量数据时,一些问题就会显现-- ...

  6. 牛逼的python代码_几段牛逼的 Python 代码理解面向对象

    Python技术相关的干货加群: 227435450 Python 有什么好处?功能强大,使用简单,语言唯一性的特征明显(唯一性的意思就是你不能用十八种写法实现一个功能),而且具备海量的第三方库--P ...

  7. 介绍一个牛逼的Github项目

    欢迎关注天善智能,我们是专注于商业智能BI,人工智能AI,大数据分析与挖掘领域的垂直社区,学习,问答.求职一站式搞定! 对商业智能BI.大数据分析挖掘.机器学习,python,R等数据领域感兴趣的同学 ...

  8. 推荐一个牛逼的 GitHub 项目+支付宝、微信支付项目实战!快来获取!

    福利一 原创电子书历时整整一年总结的 Java 面试 + Java 后端技术学习指南,这是本人这几年及校招的总结,各种高频面试题已经全部进行总结,按照章节复习即可,已经拿到了大厂offer. 原创思维 ...

  9. python 入门到实践期末考试常出现的考试内容_零基础Python入门及实践应用_章节测验,期末考试,慕课答案查询公众号...

    零基础Python入门及实践应用_章节测验,期末考试,慕课答案查询公众号 更多相关问题 不属于厌食证的病因病机为:() A.喂养不当 B.他病伤脾 C.先天不足 D.气滞血瘀 E.情志失调 点刺四缝穴 ...

最新文章

  1. Unit Test测试框架中的测试的执行顺序
  2. Android开发--图形图像与动画(五)--详解LayoutAnimationController
  3. android Hander Service 广播的综合使用案例
  4. oracle两列同时去重_Oracle表中重复数据去重的方法实例详解
  5. lvs + keepalive的安装配置
  6. redis用list做消息队列
  7. 关于计算机图形学的学习
  8. APICloud 上传文件到云数据库2.0的代码实现
  9. 查理·芒格:分享12个顶级思维模型
  10. Tomcat启动,提示 The JRE_HOME environment variable is not defined correctly 问题。
  11. 苹果笔记本电脑亮度无法调节_macbook怎么调节屏幕亮度|苹果笔记本调显示器亮度方法...
  12. ffmpeg 合并音乐+视频报错之[mp4 @ 000002b9bcfa1ec0] Non-monotonous DTS in output stream 0:1; previous: 1136042
  13. 鸿蒙断更术辰东,唐家三少说出《圣墟》断更真相,这次不怪辰东,网文将大范围断更...
  14. 2020年6月——北京大学《软件工程》笔记
  15. pygame设计舒尔特方格游戏python舒尔特方格小程序
  16. P3755 [CQOI2017]老C的任务
  17. 学习记录1.0(基础算法)
  18. 推荐一个可以在电脑上玩所有下载渠道手游的安卓模拟器
  19. 如何使用HTML和CSS进行分页?
  20. 手机联系人不见了怎么恢复,试下这2招

热门文章

  1. 多态Class对象注册工厂反射动态代理
  2. Vue中使用vue-codemirror插件实现代码在线编辑
  3. n是否为质数c语言编程,C程序检查数字是否为质数
  4. matlab 指定路径保存图片_matlab批量保存图像至指定文件夹(revised) mkdir cd 等 | 学步园...
  5. Push rejected Push master to origin/master was rejected by remote
  6. Consolidate Duplicate Conditional Fragments
  7. 计算机考证可以补办吗
  8. a 便签实现 下载
  9. 教育实习手册高中计算机,【中学信息技术教师实习报告】
  10. 3D模型在线查看利器【多种格式】