- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Modern Web Automation With Python and Selenium
We can have modern web automation with Python and Selenium. To configure with Selenium webdriver in Python the steps described below need to be followed −
Step1 −To install Python in our system, visit the link − https://www.python.org/downloads/
Step 2 − Click on the Download Python <version number> button. Once the download is completed, the Python executable file should be available in our system.
Step 3 − Double-click on this executable file and the Python installation landing page should be opened. Click on Install Now.
Step 4 − Python should be available in the below path −
Step 5 − We shall configure the path of the folders - Python and Scripts (introduced within the Python folder) in the Environment variables for the Windows users.
Step 6 − To verify, Python has been installed, run the command: python --version. The Python version should get displayed.
Step 7 − Selenium bindings installation can be done by executing the command: pip install selenium.
Step 8 − A folder called Selenium should be found within the Python folder. To update the Selenium existing version, run the command: pip install –U selenium.
Step 9 − Finally, we should also have a Python editor - PyCharm to create the Selenium scripts((https://www.jetbrains.com/pycharm/).
Step 10 − To launch the Selenium script in a browser, we also need to download the browser drivers. For this, visit the below link − https://www.selenium.dev/downloads/
Step 11 − Scroll down to the Browser section and to download the browser drivers for different browsers.
from selenium import webdriver #configure chromedriver path driver = webdriver.Chrome(executable_path='../drivers/chromedriver') #implicit wait driver.implicitly_wait(0.5) #url launch driver.get("https://www.tutorialspoint.com/questions/index.php") print('Page title: ' + driver.title) #browser close driver.close()
- Get Started With Selenium and Python Automation
- Selenium Web Test Automation Framework Best Practices.
- Why use Selenium WebDriver for Web Automation?
- Google Search Automation with Python Selenium
- How to use Selenium WebDriver for Web Automation?
- Save a Web Page with Python Selenium
- What is the difference between selenium and automation?
- How to get text with selenium web driver in python?
- Difference between selenium RC and Web Driver?
- Mouse and keyboard automation using Python?
- How does selenium interact with the Web browser?
- Get text using selenium web driver in python?
- What is selenium web driver?
- What is Web Driver in Selenium?
- Selenium versus BeautifulSoup for Web Scraping.