250x250
반응형
Notice
Recent Posts
Recent Comments
Link
«   2024/06   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Archives
Today
Total
관리 메뉴

BEAT A SHOTGUN

[TROUBLESHOOTING] selenium error 본문

TROUBLESHOOTING

[TROUBLESHOOTING] selenium error

thovy 2023. 7. 13. 00:09
728x90
반응형
SMALL

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

728x90
반응형
LIST
Comments