4ye tearfully used Python to crawl the fan data of her official account

Dear friends, recently I was in the knowledge of Gateway, the result was absent-minded ha ha ha, the result had to finish this matter and continue!! ε=ε=ε=( ̄▽ ̄)

Originally this article had to be sent yesterday, but the bill has made a big surprise ~ (expression 👉 🙂 (o=^• hikaru •)o stamps, ━ bill

I will try to prepare as many spare articles as possible in the future, so as to avoid frequent interruptions

The cause of

Let me tell you briefly what happened

Due to New Year’s day is a holiday hair drops of red envelopes frequently lately ~ have a lot of friends to add me, wanted to have a fan base under the active atmosphere, it was found to drop afraid not a robot, this grab a red envelope drop fast ah, and 4 ye do things too hasty No validate each other isn’t fans really wanted to come into the group to pull in Only think what’s wrong with! Too much! On the contrary, we have no idea about

Pit 🕳

I thought since I was already in the group, I would check it out by myself (only 12345678 people…). (ˉ del ˉ;) .

At that moment, I foolishly thought wechat could easily export group members ~

Try to find the web end can not use 😵

But 4YE my head iron, refused to give up, leng is to grope from the technical point of view, the result did not fix me dizzy for a long time

Ps: But now I have a new idea to try under the hey hey sell to keep in suspense ~

To the chase

A brief introduction to the characteristics of the public number ~

The public number has individual, have government organization, still have enterprise ~

The official account of 4ye is personal ~ 😝

This is also why some friends left messages on the background of the public account

Of course, small partners or add my wechat to communicate well ~

No interface permission

Personal public number is no way through wechat authentication, so the following many interfaces are not authorized (otherwise I do not have to climb 😵)

The resulting data

The final effect is shown in figure ~

Retrieve the user name and avatar into the text,

Why to save it ~ of course is when a small data, in order to find out the group behind the false powder preparation ~😝

Later, you can also do the following word cloud to see 😁 (to give you some small surprise ~ 😋)

Crawl ideas

Of course, first in the background analysis of the user list, will want to page data and access to the API issued by the next page for analysis, interested partners can first study their own oh ~

Here is a brief description of the packages used (note that HTTP2.0 is used here).

import requests
from bs4 import BeautifulSoup
from hyper.contrib import HTTP20Adapter
Copy the code

Res. encoding = ‘utF-8’

Fo = open(“fans.txt”, “a+”, encoding=’ utF-8 ‘)

The last

I also packed up ready to go back to Guangzhou ~ seeyou😝

Welcome attention, make a friend!! (•̀ ω •́)y

Java4ye A little white blogger focused on productivity ~(increasing groping time), sharing learning resources, technological awareness, little things about programmer life let us groping together ~(● world twentyconsciousness) Java4ye here to prepare a series of learning resources for you, as well as a variety of plug-ins, software oh welcome message! Thanks for your support! O (≧ ヾ del ≦ *)