In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "Vue3.0+TS enterprise practical application analysis", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Vue3.0+TS enterprise practical application analysis" it!
There is a requirement that you need to simulate login to csdn to obtain cookie, and then perform a series of operations on csdn. The selenium function that you just started to use can be realized, but the efficiency is a little low.
Later changed to use requests, encountered a lot of holes, today to sum up.
First of all, find the url of the csdn login, and click to log in if you deliberately type the wrong password. Check that there is a dologin response in the network, which is the account password information to be submitted to the server. Click open and you will find the following figure: the url of the request and the post of the request method
If you continue to scroll down, you can find the request information we sent to the server. Pwd is the password we submitted, and user is the account we submitted. I don't know what to use for the rest of the time, but in the follow-up operation, we found that uatoken and webumidtoken are optional. Unlike previous form submissions, this is request payload. I tried to submit it several times with form and found it didn't work, so I began to look for information on the Internet, and a great god gave the answer.
The solution is as follows:
1. When you put the contents of request payload into a dictionary, and then send a post request, use json.dumps () to convert the dictionary parameter into a string format and pass it in.
2. You can see that the content-type field value of its request header is aoolication/json, that is, it is a parameter passed by json, so we can change the data parameter in requests to json, such as:
Res = requests.post (url, headers=header, json=data) .text
)
The place to play mosaic is our account number and password, just enter your own account password. At this stage, the simulated landing is done.
The next step is to get cookie, a very simple line of code (ps: response.cookies gets a cookiejar object, and you need to use requests.utils.dict_from_cookiejar to convert the cookiejar object into a dictionary, which can be passed in on request later, such as requests.get (url, cookies=cookies)).
Cookies = requests.utils.dict_from_cookiejar (response.cookies)
At this point, I believe that you have a deeper understanding of the "Vue3.0+TS enterprise practical application analysis", might as well come to the actual operation! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.