Skip to main content

Selenium package with requests integration and anti-bot detection measures

Project description

ak_selenium

Selenium package with requests integration and anti-bot detection measures

Documentation · Report Bug · Request Feature


GitHub commit activity GitHub last commit tests

Table of Contents

1. About the Project

1.1. Features

  • Launch Selenium with custom options
  • Automatically try to add Chrome UserData
  • Add anti-bot detection measures
  • Pass selenium headers/cookies to requests library

2. Getting Started

2.1. Dependencies

Create the virutual environment and install dependencies

python -m venv .venv

.venv\Scripts\activate.bat

pip install flit

2.3. Installation

2.3.1. Production

Install with flit

  flit install --deps production

Alternatively, you can use pip

pip install ak_selenium

2.3.2. Development

Install with flit

  flit install --pth-file

3. Usage

from ak_selenium import Chrome, By, Keys
chrome = Chrome(
    headless=False, # Start Chrome in headless mode
    chrome_userdata_path=r"path\to\user\data", #Defaults to correct location in windows
    half_screen=True, # Set the browser to half the screen size (Only applicable if NOT `headless`)
    )

#Get Chromedriver
driver = chrome.init_chrome()

#Get the website
driver.get("https://example.com")

#Wait for elements to load
locator = (By.TAG_NAME, "h1")
chrome.Wait_for_locator(locator)

#Get requests Session
s = chrome.update_req_headers_cookies()
s.get("https://www.iana.org/domains/reserved")

Additional Options

Additional Options

4. Roadmap

  • Add beautifulsoup integration
  • Proxy

5. License

See LICENSE.txt for more information.

6. Contact

Arun Kishore - @rpakishore

Project Link: https://github.com/rpakishore/ak_selenium

7. Acknowledgements

Project details


Download files

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

Source Distribution

ak_selenium-0.0.4.tar.gz (127.9 kB view hashes)

Uploaded Source

Built Distribution

ak_selenium-0.0.4-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page