PXM2 Selenium Helper
Official Selenium WebDriver and Selenium-Wire proxy helper for PXM2 dedicated 4G and 5G cellular mobile proxies.
Standard Selenium Chrome does not support authenticated proxies via command-line arguments. pxm2-selenium solves this by automatically generating a lightweight in-memory background extension that handles Chrome proxy authentication seamlessly, while also offering instant modem IP rotation.
For full setup walk-throughs and code samples, check out the PXM2 Integration Guides.
Features
- Automatic Chrome Proxy Extension Injection: Solves Selenium Chrome proxy authentication by generating signed proxy extensions on the fly.
- Selenium-Wire Compatibility: Ready-to-use proxy configuration dictionary for
seleniumwire.webdriver. - Hardware IP Rotation: Trigger 1-click cellular modem reconnect webhooks directly from Python with automated reconnection cooldown.
- In-flight IP Inspection: Check your current mobile CGNAT IP through the proxy using Python stdlib.
- Zero Heavy Dependencies: Pure standard library implementation.
Installation
pip install pxm2-selenium
Usage
1. Standard Selenium WebDriver (with Auto Chrome Extension)
from selenium import webdriver
from pxm2_selenium import PXM2Selenium
# Initialize PXM2 client
pxm = PXM2Selenium(
host="proxy.pxm2.io",
port=10001,
username="your_username",
password="your_password",
rotation_url="https://api.pxm2.io/rotate/YOUR_API_TOKEN",
cooldown=6.0
)
options = webdriver.ChromeOptions()
# Automatically injects proxy credentials extension into Chrome
pxm.apply_to_chrome_options(options)
driver = webdriver.Chrome(options=options)
driver.get("https://api.ipify.org?format=json")
print("Initial IP:", driver.page_source)
# Trigger instant physical mobile IP rotation
print("Rotating mobile IP...")
pxm.rotate()
driver.get("https://api.ipify.org?format=json")
print("Rotated IP:", driver.page_source)
driver.quit()
2. Selenium-Wire
from seleniumwire import webdriver
from pxm2_selenium import PXM2Selenium
pxm = PXM2Selenium(
host="proxy.pxm2.io",
port=10001,
username="your_username",
password="your_password",
rotation_url="https://api.pxm2.io/rotate/YOUR_API_TOKEN",
cooldown=6.0
)
# Launch Selenium-Wire with PXM2 mobile proxy
driver = webdriver.Chrome(seleniumwire_options=pxm.selenium_wire_options())
driver.get("https://httpbin.org/ip")
print("Current IP:", driver.page_source)
# Rotate IP on demand
pxm.rotate()
driver.get("https://httpbin.org/ip")
print("Rotated IP:", driver.page_source)
driver.quit()
Why PXM2 4G/5G Mobile Proxies?
Unlike datacenter or common residential proxy networks that suffer from frequent subnet bans and CAPTCHA challenges, PXM2 uses dedicated physical cellular modems with SIM cards from major mobile carriers.
Because cellular networks route thousands of legitimate mobile phones through shared Carrier-Grade NAT (CGNAT) pools, anti-bot engines (DataDome, Cloudflare, PerimeterX) cannot ban these IPs without blocking real consumer traffic.
Explore more resources:
License
MIT License. See LICENSE for details.
Metadata
Release files for pxm2-selenium 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pxm2_selenium-1.0.0.tar.gz | 6.9 kB | Without provenance | Details for pxm2_selenium-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pxm2_selenium-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pxm2_selenium-1.0.0-py3-none-any.whl |
Total release size: 13.6 kB
Release files / pxm2_selenium-1.0.0.tar.gz
| Download URL | pxm2_selenium-1.0.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ed3e4e09a0d474a855c88b77ae372df258699950de707e8a423ebd23c894df4
|
|
BLAKE2b-256 checksum How to use checksums |
2ff15abcac972cbc54b85c1086b30078b3f97804a65fa3277a266836b2f6d2a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / pxm2_selenium-1.0.0-py3-none-any.whl
| Download URL | pxm2_selenium-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6c63539efaa06db516b532890e437e918a9c2d1b16ca049b6221d8f7c737f41
|
|
BLAKE2b-256 checksum How to use checksums |
ae1d757e94f270eed3d10dcbea410d360dc0550d0ce2da41f2565d4b12ee167a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Security for pxm2-selenium 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.