From the course: Using Python for Automation (2019)

Unlock this course with a free trial

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

Basic browser interactions

Basic browser interactions

- [Man] In this video, I'll be covering how to open a browser and the basics of how Selenium interacts with the web. To test our code, we'll be using this website, seleniumeasy.com. Here, we can practice implementing some of the basic Selenium functions. I'll be working with this specific test case, which can be found by clicking the input forms, and then simple form demo. So, go ahead and copy this URL, and lets get started. I'll start by importing the webdriver module from Selenium. Webdriver is basically a browser that Selenium will use to interact with the web. To use it, the first step is to initialize our webdriver. So, to do that we'll do driver = webdriver.Chrome. If you installed Gecko driver replace Chrome with Firefox. Next, we need to get the URL. To do this, do driver.get, and then paste our URL. At this point, our code should open up a browser, and then change the URL to the one we have here. Lets quickly run our code to check if this is indeed the…

Contents