Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Fork of selenium-requests that extends Selenium WebDriver classes to include the functionality from the Requests-HTML library, while doing all the needed cookie and request headers handling. Credit for most of what makes this work goes toto Chris Braun and his original work done on Selenium-Requestshttps://github.com/cryzed/Selenium-Requests

Project description

Selenium Requests HTML
=================
Extends Selenium WebDriver classes to include the [HTMLSession](http://html.python-requests.org/) from the [Requests-HTML](http://html.python-requests.org/) library, while doing all the needed cookie and request headers handling.

This hasn't really been tested and is not likely to get a whole lot of work done on it. My initial tests seemed to work for my use case. Most functionality worked with another webdriver, but the render function in Requests-HTML has a dependency that uses chromedriver and I have not yet looked into a way around it.

Most of the work already seemed to have been done, thanks to the organization and work already done in [Selenium Requests](https://github.com/cryzed/Selenium-Requests) and [Requests-HTML](http://html.python-requests.org/), as well as the original [Requests](http://python-requests.org/) library.

Usage
-----
```python
# Import any WebDriver class that you would usually import from
# selenium.webdriver from the seleniumrequestshtml module
from seleniumrequestshtml import Chrome
from selenium.webdriver.chrome.options import Options

# Set up the options for your webdriver
url = 'https://illsea.com'
options = Options()
options.add_argument("--headless")
webdriver = Chrome(chrome_options=options)

# webdriver.requests_session replaces regular HTMLSession() usage from requests-html
session = webdriver.requests_session
# then just do requests-HTML things
response = session.get(url)
images = response.html.find('img')

print(images)

Project details


Release history Release notifications

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for selenium-requests-html, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size selenium_requests_html-1.0-py3-none-any.whl (7.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size selenium-requests-html-1.0.tar.gz (8.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page