AttributeError: ‘WebDriver’ object has no attribute ‘findElement

We Are Going To Discuss About AttributeError: ‘WebDriver’ object has no attribute ‘findElement. So lets Start this Python Article.

AttributeError: ‘WebDriver’ object has no attribute ‘findElement

  1. How to solve AttributeError: 'WebDriver' object has no attribute 'findElement

    selenium webriver in python doesn't have findElement method.
    it has:
    driver.find_element(By.XPATH, 'your xpath')
    try to check all of the methods with:
    print(dir(driver))
    try the code:
    import time from selenium import webdriver from selenium.webdriver.common.by import By driver = webdriver.Chrome() driver.get("https://moitane.ge/shop/5-gudvili/43-axali-xorci-da-xorcproduqti") time.sleep(3) el = driver.find_element(By.XPATH, "//div[@class='style__ShopProductSubCategoryChip-sc-1bc3ssb-2 iKSeHs']") el.click() time.sleep(3) driver.quit()

  2. AttributeError: 'WebDriver' object has no attribute 'findElement

    selenium webriver in python doesn't have findElement method.
    it has:
    driver.find_element(By.XPATH, 'your xpath')
    try to check all of the methods with:
    print(dir(driver))
    try the code:
    import time from selenium import webdriver from selenium.webdriver.common.by import By driver = webdriver.Chrome() driver.get("https://moitane.ge/shop/5-gudvili/43-axali-xorci-da-xorcproduqti") time.sleep(3) el = driver.find_element(By.XPATH, "//div[@class='style__ShopProductSubCategoryChip-sc-1bc3ssb-2 iKSeHs']") el.click() time.sleep(3) driver.quit()

Solution 1

selenium webriver in python doesn’t have findElement method.

it has:

 driver.find_element(By.XPATH, 'your xpath')

try to check all of the methods with:

print(dir(driver))

try the code:

import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("https://moitane.ge/shop/5-gudvili/43-axali-xorci-da-xorcproduqti")
time.sleep(3)
el = driver.find_element(By.XPATH, "//div[@class='style__ShopProductSubCategoryChip-sc-1bc3ssb-2 iKSeHs']")
el.click()
time.sleep(3)
driver.quit()

Original Author Vova Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment