[TROUBLESHOOTING] selenium error

THOVY·2023년 7월 12일
0

Error 1

Error message

selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid locator

solution


driver.find_element("class_name", "AAA").click() ❌
🔽
from selenium.webdriver.common.by import By
driver.find_element(By.CLASS_NAME, "AAA").click()

참고
https://stackoverflow.com/questions/71097378/selenium-common-exceptions-invalidargumentexception-message-invalid-argument

Error 2

Error message

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".A A A"}

solution

driver.find_element(By.CLASS_NAME, "A A A").click() ❌
🔽
driver.find_element(By.CLASS_NAME, "A.A.A").click()

참고
https://zeuskwon-ds.tistory.com/67

profile
BEAT A SHOTGUN

0개의 댓글