Code for Find Element by ID using Selenium and Python

from selenium import webdriver
import time


class ExampleHTMLId:

    def testID(self):
        baseURL = 'https://myfewsteps.blogspot.com/2020/04/selenium-practice.html'
        driver = webdriver.Chrome(executable_path='../drivers/chromedriver')

        driver.get(baseURL)

        elementID = driver.find_element_by_id('fname')

        if elementID is not None:
            print('Found ID element')
            print(elementID)

        time.sleep(50)

cd = ExampleHTMLId()
cd.testID()

Popular posts from this blog

GOOGLEFINANCE attributes

Practice

Merge/join two or more video files using Python