Python helps the 2020 postgraduate entrance examination adjustment to obtain 2020 postgraduate entrance examination university adjustment information

Overview

Recently, the results of the postgraduate entrance examinations of major universities have basically come out. After the results of the postgraduate entrance examinations came out, several are happy and sad.

The editor is also a graduate student who has passed the postgraduate entrance examination. As a person who has passed, I think the current situation should be that a hundred people have a hundred moods. In the case of postgraduate entrance examinations, to put it plainly, if you successfully land ashore, you will have more paths and more chips; if you fail to land, you need to find another way. It's really hard to say about life's encounters. In short, the postgraduate entrance examination does not determine your future life. We can feel disappointed and discouraged by this failure, but don't discourage the whole self. It is very necessary to reflect on it. For example, those efforts to move oneself have not gained real efficiency and knowledge absorption. Hope this passage can comfort your mood at this time, come on.

I did not volunteer to go ashore. It can be said that I failed in the postgraduate entrance examination. However, after the failure, I did not give up on myself. Although it was difficult to find a job and adjust, I have been working hard to fight for it. Adjust a very good school.

This tweet was written in retrospect when I could not find a college when I transferred. The road to adjustment is long. The first step is to find colleges and universities that accept adjustments. Therefore, the editor uses crawler technology to grab the adjustment information of some platforms for use by friends in need (of course, I hope that the 2020 graduate students will not use it. It’s more fragrant if you volunteer to land)

Here I only list a part of the data of the adjustment colleges. For more data, please reply to the "Adjustment" in the backstage of the official account. I wish you a successful landing. Bless Wuhan, bless Hubei, bless China, bless the world!

Project overview

In fact, there is no difference from what I wrote before, so I won’t go into details here. For details, please refer to dozens of lines of code to download HD wallpapers in batches.

Part of the code

Build url

# 构建所有url
def get_url_list(self):
    url_list = []
    for i in range(1, 17):
        if i != 8 or 14:
            url = self.base_url.format(i)
            url_list.append(url)
    return url_list

Data analysis part of a website

# 解析存储数据
def parse_data(self, data):
    tree = etree.HTML(data)
    info_list = tree.xpath("//div[@class='info-item font14']")
    for info in info_list:
        school_name = info.xpath('./span/text()')[0]
        major_name = info.xpath('./span/text()')[1]
        info_title = info.xpath('./span/a/text()')
        info_time = info.xpath('./span/text()')[2]
        global n

        sheet.write(n, 0, school_name)
        sheet.write(n, 1, major_name)
        sheet.write(n, 2, info_title)
        sheet.write(n, 3, info_time)

        n = n + 1

Get data view

Python helps the 2020 postgraduate entrance examination adjustment to obtain 2020 postgraduate entrance examination university adjustment information

Guess you like

Origin blog.51cto.com/15069472/2577370