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
Table of Contents
- 1. About the Project
- 2. Getting Started
- 3. Usage
- 4. Roadmap
- 5. License
- 6. Contact
- 7. Acknowledgements
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.driver
#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.session
s.get("https://www.iana.org/domains/reserved")
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
Release history Release notifications | RSS feed
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.1.0.tar.gz
(128.0 kB
view hashes)
Built Distribution
Close
Hashes for ak_selenium-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd68765749df962654a5d213d6c7ab2654f76bf25f18173997cf7fd987d8ba44 |
|
MD5 | 9a21241dccf72ef515cda6c3342bdbb1 |
|
BLAKE2b-256 | f3c343668e8b0a82991dbee2b69b16e1aac40320d0aad7a0d1b21166d76bd91c |