geckordp
raw JSON → 1.0.3 verified Fri May 01 auth: no python
A client implementation of Firefox's Remote Debug Protocol (CDP-based) for automating and debugging Firefox via DevTools. Version 1.0.3, active development, monthly releases roughly.
pip install geckordp Common errors
error FileNotFoundError: [Errno 2] No such file or directory: 'firefox' ↓
cause Firefox is not installed or not in PATH.
fix
Install Firefox and ensure the binary is accessible. On Ubuntu: 'sudo apt install firefox'. On macOS: place in /Applications/Firefox.app/Contents/MacOS/firefox or symlink.
error OSError: [Errno 98] Address already in use ↓
cause Default port (9222) is taken by another Firefox or geckordp instance.
fix
Specify a custom port: driver = GeckoDriver(port=9223). Also kill leftover Firefox processes.
Warnings
breaking geckordp requires Python >= 3.10. It will not install on older Python versions. Update your Python runtime. ↓
fix Use Python 3.10+ or consider an older release of geckordp (none exist, so upgrade Python).
gotcha geckordp launches a *new* Firefox instance each time start() is called. It does not attach to an existing browser. Ensure no other Firefox processes interfere. ↓
fix Kill all Firefox processes before calling start() if you encounter port conflicts.
deprecated RDP (Remote Debug Protocol) is being phased out in future Firefox versions. This library may stop working with Firefox releases after 2025. ↓
fix Monitor Firefox changelogs and consider migrating to WebDriver BiDi in the long term.
Imports
- geckordp
import geckordp - GeckoDriver wrong
from geckordp import GeckoDrivercorrectfrom geckordp.rdp_client import GeckoDriver - FirefoxProfile
from geckordp.profile import FirefoxProfile
Quickstart
import geckordp
from geckordp.rdp_client import GeckoDriver
from geckordp.profile import FirefoxProfile
profile = FirefoxProfile()
profile.set_preference('xpinstall.signatures.required', False)
driver = GeckoDriver(profile=profile)
driver.start()
print('Firefox launched with remote debugging on port', driver.port)
driver.stop()