Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize ticket grabbing on Barley Network by python+selenium

Shulou Source: shulou.com Published: 2022-06-02 02:43:13 10月03日 Update

Today, I will talk to you about how python+selenium can achieve barley network ticket grabbing. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

Share the program written by the elder brother to everyone, and then realize python to grab the barley net concert ticket.

I will only introduce the method of using Google browser here.

1. First of all, you need to install the environment of python and python 3.6 +.

Install the python environment

Https://www.runoob.com/python3/python3-install.html

Anyone who is interested in python can also read this book.

2. Just download a Google browser and download the latest one. When you download Chrome driver, you must remember that the two versions must be the same. At the beginning, I made a mistake because of the inconsistency of the version.

Chromedriver download link

Https://chromedriver.chromium.org/

3. Dependent installation, pip install selenium

4. Enter the corresponding configuration information in config.json. The details are as follows:

"sess": [# priority list of events. For example, there are three sessions in this example. According to the table below, select 1 first, then 2, and finally 3. You can also set only 1.

one,

two,

three,

]

"price": [# fare priority. For example, there are three classes of fares in this example. According to the table below, you can choose 1 first and then 3. You can also set only one fare.

one,

three

]

"date": 0, # Select the date, default is 0 means no selection

"real_name": [# Real name serial number. For example, there are two real names in this example. Select two real names according to the serial number, and leave it blank to indicate that there is no need to purchase tickets with real names.

one,

two

]

"nick_name": "your_nick_name", the nickname of the # user, used to verify whether the login was successful

"ticket_num": 2, # number of votes purchased

"damai_url": "https://www.damai.cn/", # Barley website address

"target_url": "https://detail.damai.cn/item.htm?id=599834886497", # Target ticketing website

"browser": 0 # browser category, 0 is Chrome (default), 1 is Firefox

Then be sure to modify the configuration file, and then modify your user nickname.

It is estimated that some enthusiasts are not very good at using git and then pack the files into the blues.

Cloud

Https://www.lanzous.com/i71do8d

Well, you also need to download a pycharm to grab tickets.

Or you'll have to hit the command line.

After reading the above, do you have any further understanding of how python+selenium realizes the barley network ticket grabbing? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Select barley real name content browser browse consistent priority show serial number file nickname version environment user ticket price URL configuration success three Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Technology Microsoft Apple Xiaomi