Skip to content

Instantly share code, notes, and snippets.

@abhianair
Created October 24, 2019 04:48
Show Gist options
  • Save abhianair/8e7dbcf962affe368c46f2b8d4c13a8e to your computer and use it in GitHub Desktop.
Save abhianair/8e7dbcf962affe368c46f2b8d4c13a8e to your computer and use it in GitHub Desktop.
Selenium-Python-Chromedriver-Windows webpage automation initial setup
#chrome driver installation
link: https://chromedriver.chromium.org/
#download the chromedriver respective to the version of your chrome webbrowser
#unzip the downloaded file and move "chromedriver.exe" to a folder or a working directory
#run the "chromedriver.exe" before the automated script runs.
#selenium module installation using pip
pip install selenium
#modules needed to imported in the script
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
#driver initialisation in python script
driver = webdriver.Chrome('[path-to-chromedriver]/chromedriver')
#if chromedriver present in working directory
driver = webdriver.Chrome('chromedriver')
#userful tutorials
https://www.browserstack.com/guide/python-selenium-to-run-web-automation-test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment