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.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
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.0.3.tar.gz
(127.8 kB
view hashes)
Built Distribution
Close
Hashes for ak_selenium-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca897f3b8ef1c9dd9898877b0f3f3fc10235ca4de7d199cd91fc0debc3ca0f46 |
|
MD5 | eed640b52f665ea836ba5cd308444acf |
|
BLAKE2b-256 | fbbe79fe6fc834d118f55ddafb607a354422a45cf783cd9502a6a98379b2a6f7 |