Small three: what’s wrong, small two? He’s got a long face on his face.

Small two: Alas! This is not the Spring Festival soon, and the family urged blind date…

Small three: now is not popular net love, you can try dating software.

Small two: is this thing reliable?

Small three: I haven’t used it either. Check the comments section for yourself.

Small two: It’s… But you can only go to the comments section first.

In this paper, 360 mobile assistant is taken as an example. The address is http://zhushou.360.cn/. Three popular dating apps are selected, namely jiayuan, Baihe And Youyuan.com. Let’s take a look at the number of downloads and the percentage of medium and negative reviews for the three apps.

Let’s start to climb the comment area and take Jiayuan as an example. First, enter Jiayuan in the search box to search, as shown in the picture:

Then, click the software to enter its details page, as shown in the picture:

Scroll down to see the comments section, as shown below:

Now open the developer tools and select the Network TAB, click to see more comments, and you’ll see the getComments request as shown:

Parameter star is the initial comment index, parameter count is the number of comments loaded each time, you can specify different applications by parameter callback, baike, crawl code as follows:

headers = {
    "Accept": "* / *"."Accept-Encoding": "gzip, deflate, sdch"."Accept-Language": "zh-CN,zh; Q = 0.8"."Connection": "keep-alive"."Host": "comment.mobilem.360.cn"."User-Agent": "Mozilla / 5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36 LBBROWSER"
}
def comment_spider(param, file_name) :
    base_url = "http://comment.mobilem.360.cn/comment/getComments?c=message&a=getmessage&&count=50"
    start = 0
    for i in range(1.50) :print("{} page.format(i))
        url = base_url + param + "&start=" + str(start)
        r = requests.get(url, headers=headers)
        data = re.findall("{\"errno\"(.*)\); }catch\(e\){}", r.text)
        Convert to Json format
        jdata = json.loads("{\"errno\"" + data[0])
        for message in jdata["data"] ["messages"]:
            content = message["content"]
            print(content)
            with open(file_name + ".txt"."a", encoding="utf-8") as f:
                f.write(content)
        start = start + 50
        time.sleep(2)
Copy the code

We will crawl the comment data to TXT file.

Then, we will comment data for word cloud display, code implementation is as follows:

with open("yy.txt"."r", encoding="utf-8") as f:
    content = f.read()
    stylecloud.gen_stylecloud(text=content, max_words=600,
                              collocations=False,
                              font_path="SIMLI.TTF",
                              icon_name="fas fa-heart",
                              size=800,
                              output_name="yy.png")
    Image(filename="yy.png")
Copy the code

Finally, the user’s evaluation of the above software is viewed through the word cloud.

Good luck in the century:

Lily marriage and Love:

Decree by destiny,

Mistress 2: After reading the comments on Youyuan.com, I feel that I am excluded from dating apps…

Small three:…

The source code is available in Python 201207.

Disclaimer: This article does not constitute any recommendation for the use of the above dating software.