Skip to main content

easy-chrome-driver: Abstraction for chrome driver for easy modifications

easy-chrome-driver is a Python package that provides fast and flexible modifications in chrome driver by overcoming frequent errors.It supports proxy implementation and updation along with generating session id and session url which is useful to reuse the existing webdriver window.

Main Features

Here are the things that easy_chrome_driver does well without much effort:

  • Setting up proxy using chrome web extension created by easy_chrome_driver module.

  • Using username and password for the proxies

  • Updating the proxy list automatically along with manual addition

  • Saving user data and session metadata for the reuse of chrome driver session.

  • Running chrome driver headless without any errors

  • Using any driver path for the chrome driver

Source Code

The source code is currently hosted on GitHub at: https://github.com/vaibhavkpatel1/easy_chrome_driver

Dependencies

Installation

easy-chrome-driver can be installed from PyPI:

pip3 install easy-chrome-driver

License

MIT

Documentation

Create instance for proxy_driver, update proxies and get driver

from easy_chrome_driver import proxy_driver as pc
pc().update_proxies()
driver = pc('user_name','password').get_chromedriver(use_proxy=True)
proxy_driver(PROXY_USER='',PROXY_PASS='',user_path = None)
    Create a driver class with the above parameters

Parameters:

    PROXY_USER : string, default ''
        User name for the Proxies in proxies.json file in proxy_driver folder.
    PROXY_PASS : string, default - ''
        Password for the Proxies in proxies.json file in proxy_driver folder.
    user_path : string, default './proxy_driver/user_data'
        Path to store user data generated during scrapping.

See also
    proxy_driver.get_chromedriver(), proxy_driver.update_proxies()
get_chromedriver(self,use_proxy = False,save_user_data = True, user_agent = True,headless = False,download_path = file_path, driver_path = None)
    Create chrome driver instance with the following parameters.

Parameters:

    use_proxy : bool, default False
        Use a random proxy selected from 'proxies.json' file in proxy_driver folder with username and password passed into proxy_driver class.
        To update the 'proxies.json' run proxy_driver().update_proxies()
        or Manually add the proxy as 'proxy:port':type in the json file. Eg. '172.67.182.48:80':http

    save_user_data : boo;, default True
        Saves the user data generated while using web driver in the user_data folder.
    user_agent : bool, default True
        Changes user agent every time the web driver is called.
    headless : bool, default False
        Run the driver without opening it. i.e. in the background
    download_path : bool, default './proxy_driver'
        To change the default download path of the chrome driver
    driver_path : bool, default None
        To change the default driver path of the chrome_driver. For default path refer chromedriver documentation.
        https://chromedriver.chromium.org/getting-started

Update proxies

This code must be run before the first time use of proxy, else create the json file manually in the proxy_driver folder. Eg. Eg. ‘172.67.182.48:80’:http

pc().update_proxies()
update_proxies(self,no_of_pages = 3,driver_path = None)
    Update the 'proxies.json' file in the proxy_driver folder with fresh free ips.

Parameters:

no_of_pages : int, default 3
    To get large number of proxies increase the number of pages.
driver_path : str, default None
    If the executable file of driver is at different location than default. For default location refer chromedriver documentation.
    https://chromedriver.chromium.org/getting-started

Following folders will be created in your current directory

proxy_driver\
    user_data\
    proxy_auth_plugin.zip
    proxies.json
    log.txt

Change Log

0.0.1 (08/03/2021)

  • First release

0.0.2 (09/03/2021)

  • Major updates in code and documentation

Release files for easy-chrome-driver 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easy-chrome-driver 0.0.2
File Size Uploaded
easy_chrome_driver-0.0.2.tar.gz 7.0 kB Details

Release files / easy_chrome_driver-0.0.2.tar.gz

Download URL easy_chrome_driver-0.0.2.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3068982b61f770c13a3bd5d2d77a620c27675f3b1227b24ed0546eba9aaa36f2
BLAKE2b-256 checksum
How to use checksums
5f2241edeb964ea17d8cd61224210592e17f7c628e800221668ac1e754222a2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page