Accessing browser properties

In this section, we will demonstrate the use of Selenium and Chrome WebDriver to load Google Chrome with URLs and access certain browser-based features.

To begin with, let's import webdriver from selenium and set a path to chromedriver.exe—let's call it chromedriver_path. The path created will be required to load Google Chrome. Depending on the application location, the complete path to chromedriver.exe should be mentioned, and is required for successful implementation:

from selenium import webdriverimport re#setting up path to 'chromedriver.exe'chromedriver_path='chromedriver' #C:\\Users\\....\\...\chromedriver.exe 

The selenium.webdriver is used to implement various browsers, in this case, Google Chrome. The ...

Get Hands-On Web Scraping with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.