
Hands-on installation of BeautifulSoup with proxy IPs
Recently, a lot of partners in the network crawler project, found that pip load BeautifulSoup is always stuck. Especially in some areas of the network environment is not stable, download python library is like squeezing toothpaste. At this time, if you know how to use a proxy IP, the speed of loading packages can directly take off!
Necessary preparations before packing
Make sure it's installed on your computer first.Python 3.6 or higher(Older versions are prone to bugs). Hold down Win+R and type cmd, type this command in a black window to check the version:
python --version
If you can't find the command, you probably don't have the environment variable. At this point, we recommend that you go to the python website and reinstall it, remembering to check theAdd Python to PATHThat option.
The right way to open a proxy IP
Here's a focus on our savioripipgo proxy service. Their residential proxies are particularly well suited for network requests and support the http/https/socks5 protocols. Taking the http proxy as a chestnut, the install command should look like this:
pip install beautifulsoup4 --proxy=http://用户名:密码@gateway.ipipgo.com:端口号
Pay attention to replace the username, password and port, these parameters can be found in the backend of ipipgo. If you don't like the trouble of typing commands every time, you can set them directly in the system environment variables:
set http_proxy=http://用户名:密码@gateway.ipipgo.com:端口号
set https_proxy=http://用户名:密码@gateway.ipipgo.com:端口号
Practical installation of the whole process
1. Open cmd black window (don't use powershell, it sometimes jerks)
2. Enter the proxy setup command (or configure environment variables in advance)
3. Execute the installation instructions:
pip install beautifulsoup4 --trusted-host pypi.org --trusted-host files.pythonhosted.org
The two trusted-host parameters are added to bypass SSL certificate validation, especially with older systems, to avoid a bunch of errors.
Verify that the installation was successful
Don't close the window after installing, hit this command to check the version:
python -c "import bs4; print(bs4.__version__)"
If a version number pops up (e.g. 4.10.0), it means it's installed properly. If you get an error saying that the module is not found, the proxy is probably not set correctly, so we recommend checking the package status in the ipipgo backend.
Frequently Asked Questions First Aid Kit
Q: What should I do if I always get a connection timeout?
A:先试试ping gateway.ipipgo.com能不能通,如果太高,去后台换个低的节点
Q:Halfway through the installation report SSL error?
A: Append the -trusted-host parameter to the command, or upgrade the pip version:
pip install --upgrade pip --proxy=http://...
Q: Use proxy instead of slower?
A: may be the node load is high, in the ipipgo console to switch the protocol type, try to use the socks5 protocol will sometimes have a miraculous effect!
Why recommend ipipgo
Real experience of using it down in my own home:
1. Exclusive bandwidth without traffic jam, download speed stabilized at 5MB/s+
2. Supports pay-per-use, suitable for users who occasionally load packages
3. Fast response from customer service, last time I had a problem in the middle of the night, I got back in a second!
4. Comes with IP rotation function, to prevent being pulled by the target site hacking
Recently found that their official website is doing activities, new users register to send 1G traffic, just enough to install dozens of python libraries. If you need to use it for a long time, we recommend you to chooseEnterprise PackageWith automatic failover function, there is no longer any fear of disconnection in the middle of installation.
A final word.
There are actually three key points to loading libraries with proxy IPs:
1. Choose the right service provider (must give ipipgo a call here)
2. Remember to add the trusted-host parameter.
3. Regular updating of pip version
Don't panic when you encounter problems, follow the above steps step by step to investigate, basically can be solved. If you really can't figure it out, go to the ipipgo website and look for online customer service, they are experienced in dealing with this kind of problem.

