Skip to main content

A decorator to kill Chrome if Selenium/ChromeDriver got stuck

Project description

A decorator to kill Chrome if Selenium/ChromeDriver got stuck

# Tested with:
# https://github.com/ultrafunkamsterdam/undetected-chromedriver
# Python 3.9.13
# Windows 10


$pip install a-selenium-kill

from a_selenium_kill import add_kill_selenium
from auto_download_undetected_chromedriver import download_undetected_chromedriver
import undetected_chromedriver as uc

# You have to create the instance in a function, and use the decorator @add_kill_selenium
@add_kill_selenium
def get_driver():
    folderchromedriver = "f:\\seleniumdriver2"
    path = download_undetected_chromedriver(folder_path_for_exe=folderchromedriver, undetected=True)
    driver = uc.Chrome(driver_executable_path=path)
    return driver

if __name__ == "__main__":
    driver = get_driver()
	
	#Kill Chrome:
	
	driver.die_die_die_selenium()

Project details


Release history Release notifications | RSS feed

This version

0.10

Download files

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

Source Distribution

a_selenium_kill-0.10.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

a_selenium_kill-0.10-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file a_selenium_kill-0.10.tar.gz.

File metadata

  • Download URL: a_selenium_kill-0.10.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for a_selenium_kill-0.10.tar.gz
Algorithm Hash digest
SHA256 3d5bdf95dec8147f463c629fa5455aca3653114e7496e2c3463eb0d114523b4e
MD5 e5090862ec6b26ae39469b1fae0479b3
BLAKE2b-256 cc50bb8d798641defa02114330b139e4ae19c8203603fe32311d4d41b6507916

See more details on using hashes here.

File details

Details for the file a_selenium_kill-0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for a_selenium_kill-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 d3a790cbdab8b8c974d62eea4e0b9dc3ca46dee1a1190e4bb0d38017229682d3
MD5 fa7b5d65d6df19febde661929981e7f8
BLAKE2b-256 9c72b797158d2a9fe87df6a954b905f8f9bc78bd047d3a810aff42a10f22be7b

See more details on using hashes here.

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