Skip to content

requestiumvsselenium-driverless

BSD-3-Clause 6 2 1,834
53.1 thousand (month) Dec 28 2012 0.4.0(8 months ago)
568 1 4 NOASSERTION
Jul 22 2022 9.0 thousand (month) 1.9.4(5 days ago)

Requestium is a Python library that merges the power of Requests, Selenium, and Parsel into a single integrated tool for automatizing web actions.

The library was created for writing web automation scripts that are written using mostly Requests but that are able to seamlessly switch to Selenium for the JavaScript heavy parts of the website, while maintaining the session.

Requestium adds independent improvements to both Requests and Selenium, and every new feature is lazily evaluated, so its useful even if writing scripts that use only Requests or Selenium.

Selenium Driverless is a Selenium inspired browser automation library with focus on web scraping detection bypass. It shares most of Selenium API and UX but implements several extensions that make the scraper more difficult to detect and extra usability features like: - Bypass Cloudflare - Multiple Tab scraping - Multiple context support - Proxy auth - Network interception

Example Use


from requestium import Session, Keys

session = Session(webdriver_path='./chromedriver',
            browser='chrome-headless',
            default_timeout=15)

# then session object can be used like requests and parsel:
title = session.get('http://samplesite.com').xpath('//title/text()').extract_first(default='Default Title')

# other advance functions like POST requests and proxy settings are also available:
s.post('http://www.samplesite.com/sample', data={'field1': 'data1'})
s.proxies.update({'http': 'http://10.11.4.254:3128', 'https': 'https://10.11.4.252:3128'})

# session can also be used like selenium as it exposes all selenium functions.
# like typing keys:
s.driver.find_element_by_xpath("//input[@class='user_name']").send_keys('James Bond', Keys.ENTER)
# It works the same as Selenium just with a different import.
import undetected_chromedriver as uc
driver = uc.Chrome(headless=True, use_subprocess=False)
driver.get('https://nowsecure.nl')
driver.save_screenshot('screenshot.png')
driver.close()

Alternatives / Similar


Was this page helpful?