From the course: Python Automation and Testing

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Solution

Solution

- [Instructor] Now that we have seen the challenge that we have taken up, let's take a step by step walkthrough of how to solve it. To start off, I'm going to open the code editor directly and let's jump right into the first step. As with all our code, I'm going to start off with importing the web driver from Selenium. So from Selenium import web driver. The next thing I'm going to do is create an instance of Firefox using the web driver with webdriver.firefox The first step is to navigate to the official Python website. So let's use driver.get to do that, and in here I type the URL that we want to navigate to, which is https www.python.org. And with this, we are already done with our first step. The second step is to locate an element by its id and print it out. To make the printing out easier, I'm going to create a variable element id and we are going to store the element that we find into this variable. So I use the driver dot find element by id method, and in here we are going to…

Contents