Requestium
raw JSON → 0.5.1 verified Fri May 01 auth: no python maintenance
Requestium is a Python library that merges the power of Requests (for HTTP) with Selenium (for browser automation) into a single unified session object. Version 0.5.1 requires Python >=3.10. The project appears to be in maintenance mode with no recent updates.
pip install requestium Common errors
error ModuleNotFoundError: No module named 'requestium' ↓
cause Library not installed or Python version incompatible.
fix
Ensure you are using Python >=3.10 and run: pip install requestium
error AttributeError: 'Session' object has no attribute 'driver' ↓
cause Trying to access selenium driver without initializing browser or after calling close().
fix
Initialize Session with driver_path and browser parameters: s = Session(driver_path='chromedriver', browser='chrome')
error selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH ↓
cause ChromeDriver not installed or not in PATH.
fix
Install ChromeDriver and add it to PATH, or provide the full path via driver_path parameter.
Warnings
breaking Requires Python >=3.10. Older versions do not support this library. ↓
fix Upgrade Python to 3.10+ or use an older version of requestium if available.
gotcha The library may not be actively maintained; issues and PRs may not be addressed. ↓
fix Consider using alternatives like Requests+BeautifulSoup or Selenium Wire if you need active maintenance.
deprecated Selenium 4 changed find_element API; old syntax may break. ↓
fix Use Selenium 4 compatible syntax: driver.find_element('tag name', 'body') instead of driver.find_element_by_tag_name('body').
Imports
- Session wrong
from requestium.session import Sessioncorrectfrom requestium import Session - Requestium
from requestium import Requestium
Quickstart
from requestium import Session
# Create a session with a browser (e.g., Chrome)
s = Session(driver_path='chromedriver', browser='chrome')
# Use requests interface
response = s.get('https://httpbin.org/get')
print(response.text)
# Use selenium to interact with JavaScript
try:
s.driver.get('https://httpbin.org/get')
element = s.driver.find_element('tag name', 'body')
print(element.text)
except Exception as e:
print(f'Browser not available: {e}')
finally:
s.close()