
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Running Selenium WebDriver with Python Bindings in Chrome
We can run Selenium webdriver with Python bindings in Chrome. This can be done by downloading the chromedriver.exe file. Visit the link: https://chromedriver.chromium.org/downloads. There shall be links available for download for various chromedriver versions.
Select the version which is compatible with the Chrome browser in the local system. Click on it. As the following page is navigated, select the zip file available for download for the operating system which is compatible with our local operating system.
Once the zip file is downloaded, extract it and save the chromodriver.exe file at a location. To launch the Chrome, we have to add the statement from selenium import webdriver. Also, we must have a webdriver object created.
With the help of this webdriver object we should be able to access the webdriver.Chrome(). The location of the chromedriver.exe is passed as a parameter to the Chrome class with the help of the property called the executable_path.
Example
from selenium import webdriver #path of chromedriver.exe driver = webdriver.Chrome (executable_path="C:\chromedriver.exe") #launch browser driver.get ("https://www.tutorialspoint.com/index.htm") #close browser driver.close()