Proxy server, used for browser proxy access, supports dynamic proxy switching
Project description
快捷使用
安装库
- pip install ApiProxy
编译库
- python ./setup.py sdist bdist_wheel
- pip install .\ApiProxy-1.0-py3-none-any.whl
上传库
- twine upload dist/*
卸载库
- pip uninstall ApiProxy
场景1-设置dp代理,支持socks代理
from DrissionPage import ChromiumPage,ChromiumOptions
from ApiProxy import Proxy
a=Proxy(8993,8996)
data=a.setproxyIp("http://183.158.146.144:40023")
proxyurl=data["url"]
print("proxyurl:",proxyurl)
co=ChromiumOptions()
co.set_proxy(proxyurl)
page=ChromiumPage(addr_or_opts=co)
page.get("https://www.baidu.com")
input("等待输入")
场景2-使用dp动态代理切换,支持socks代理
from DrissionPage import ChromiumPage,ChromiumOptions
from ApiProxy import Proxy
a=Proxy(8993,8996)
data=a.setproxyIp("http://183.158.146.144:40023")
proxyurl=data["url"]
print("proxyurl:",proxyurl)
co=ChromiumOptions()
co.set_proxy(proxyurl)
page=ChromiumPage(addr_or_opts=co)
page.get("https://www.ip138.com")
input("第一次切换ip")
# 再次切换代理
a.switchproxyIp("http://49.87.97.136:40007")
page.get("https://www.ip138.com")
input("第二次切换ip")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ApiProxy-0.0.4.tar.gz
(54.0 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ApiProxy-0.0.4-py3-none-any.whl
(54.3 MB
view details)
File details
Details for the file ApiProxy-0.0.4.tar.gz.
File metadata
- Download URL: ApiProxy-0.0.4.tar.gz
- Upload date:
- Size: 54.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59a0fab0c10006a2e0c7b30f14bd618f8cb1e309a644771da0123e4c9362aac6
|
|
| MD5 |
8f809e25b93957da0b8bbc74a3266efa
|
|
| BLAKE2b-256 |
0fe6e4f40e3a2f6252dae85ab00ca601fec103b64f8ee76ef1f7eaf1ceebb18f
|
File details
Details for the file ApiProxy-0.0.4-py3-none-any.whl.
File metadata
- Download URL: ApiProxy-0.0.4-py3-none-any.whl
- Upload date:
- Size: 54.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f12af65dfd7f67cbaf12caa9e037aa47f65890748c223388a457b6e311c1878
|
|
| MD5 |
06acd2b2f3e0336e9a2bff9fbac12e8b
|
|
| BLAKE2b-256 |
8f1a4b098cf479e8a71addf53145f40bff99589f86acdf16d79b9acf9ea08f3f
|