Install
pip install wechatarticles
Display address:
Daily update, get the latest article link of the public account, support daily update, read likes and comment the text
Note: This project is only for learning and communication, and is strictly prohibited for commercial use (this project cannot be used directly) and cannot reach the out-of-the-box level. To use this project, you need to read the documentation + source code + hands-on practice, and refer to the sample code (under the test
folder) for rewriting.
Tip: In addition, many friends (big guys) have already based on this set of projects or rewritten them to meet their own needs by directly looking at the source code.
Implementation idea one:
For complete ideas, you can refer to my blog: Remembering an experience of crawling WeChat public accounts (obtaining likes for reading WeChat articles)
Implementation idea two:
test_GetUrls.py
with caution, preferably without .)The permanent links to the crawled historical articles of public accounts are disclosed. The dates are as of the commit time. They are only for testing and learning. You are welcome to pay attention to these high-quality public accounts.
The project started in 2017 and is currently updated in March 2023
To adjust the project code, please use pip install wechatarticles
to call the previous interface.
Please see README for parameter file description.
python
: 3.6.2, 3.7.3 There is a limit on the number of times here, so you cannot get too many URLs at one time. Solution: Multiple accounts crawl test_WechatUrls.py at the same time
test_WechatInfo.py
test_GetUrls.py
test_Url2Html.py
You can read this issue, thank you very much for the concise explanation.
See blog and documentation below
Please see this document for how to manually obtain official_cookie and token.
For an introduction to manual acquisition of wechat_cookie and appmsg_token, please refer to this document
Contact notes :
Cannot (cannot) automatically log in to WeChat official accounts and WeChat
Can’t (can’t) do real-time (get parameters, read likes, get articles)
Changing an official account or expiring parameters require manual updating. How to obtain parameters is mentioned in the article, please read carefully.
You cannot do keyword searches (i.e. WeChat search function), such as searching for all articles containing the word "technology".
Q&A
Can the project run normally?
Answer: The project can run normally.
How to run/start xxx and what parameters need to be obtained?
Answer: Please look at the source code and run it manually to see the output error.
How to obtain xxx parameters?
Answer: The documentation and blog are very clear, please read it carefully.
I want xxxx, what should I do?
Answer: Read the documentation and source code
How to update the web page daily?
Answer: It is not a universal key. The solution is very simple, which is to simulate clicks + proxy software (Fiddler or Mitmproxy) to intercept packets and capture them once a day. If you have a better solution, please let us know. This part is not open source (if you see the relevant complete open source, you can raise an issue to learn more), purely because it is too troublesome to configure the environment + customization, and there are certain problems. If you see what can be achieved here, you can achieve it. If you ask me, I can’t answer you. It’s too time-consuming and energy-consuming.
Are WeChat and packet capture software Fiddler required on PC?
Answer: No. This is just what I understand (think) that these two are relatively easiest to complete the entire process. Alternatives: You can capture WeChat on mobile phones (both Android and IOS are available, Android requires root to capture reading and likes); there are many alternatives to the packet capture software Fiddler, as long as it can capture HTTPS packets and view the data.
How to capture articles from a large number of public accounts?
Answer: This project cannot be realized. There is no good solution, please refer to 5. The time cost of switching an official account is about 3-5 minutes, depending on the level of proficiency.
Normal way to ask questions:
Programming comes from practice. You can directly test whether the operation is correct or not. There is no need to waste the time of two people. If there is a problem during operation, please follow the above process to ask questions, but only if you have run it yourself . Please tell me your questions or needs directly without waiting for my reply. Thanks! Most of the questions can be exchanged. If you ask any detailed questions, we will also accept paid teaching.
WeChat Appreciation Code