In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to build an account sharing browser based on Python. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.
First, the pain of account restrictions
In today's Internet, free information and resources account for a large part, and all kinds of Internet applications provide information and resources for various industries. This is one of the important reasons why the Internet can continue to prosper and expand.
At the same time, some paid or private Internet applications constitute a more valuable and meaningful part of the Internet world.
Some less restrictive websites may only require user login to use the service.
For some moderately restrictive websites, account security or other factors may restrict the login of accounts within a certain range of IP for a certain period of time.
And some highly restrictive websites may need to use hardware devices (such as U shield, dongle, etc.) + account to log in, and some will also use browser plug-ins.
These restrictions on account login ensure the security of the account to a great extent, but bring great inconvenience to users.
For some reasons, we may need to share an account with restrictions on login and use to multiple people at the same time, so we can use Python to achieve this requirement perfectly.
Break through the restrictions on the use of accounts
In this scenario, we need to use the following tools:
Selenium: used to simulate login to the target website
Cookie storage service: used to store and return the Cookie of successful login to the target website
A browser based on the QWebEngine module of PyQt5 or PiSide2
We first simulate the login of the target website with the help of Selenium and maintain the login status continuously, and upload the successful login and updated Cookie to the Cookie storage service.
Then use PyQt5 or PySide2 to make a browser with the help of the browser core of its QWebEngine module.
Get the latest Cookie from the Cookie storage service at startup, and configure the obtained Cookie as the browser default global Cookie.
In this way, when we open the target site, the default is the status after login. In this way, login restrictions are eliminated
3. Handle account login IP exception
In the above-mentioned scheme, account sharing can basically be achieved, but there are also problems. For example:
When multiple users visit at the same time, the same Cookie will be matched to multiple IP addresses, which may be recognized as multiple user logins in the background of the website, resulting in frequent disconnections.
Multiple user visits will cause multiple IP addresses to appear on the same account, which will be judged as the risk of suspected user theft for some websites with higher security levels, and limit account login and access.
In the face of this situation, we need the following solutions:
In this scenario, we added a key proxy server.
This proxy server forwards all requests, including Selenium and browsers.
Selenium uses this proxy server to simulate login to the target website, and the homemade Qt browser also accesses the target website through the proxy server by default.
After joining the proxy server, no matter how many users visit the target website at the same time, the IP address presented is always the IP address of the proxy server.
In this way, it avoids the risk that the same account is used by multiple IP addresses due to multiple user visits, resulting in account disconnection and login restrictions.
This is the end of how to build an account sharing browser based on Python. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.
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.