3 글 보임 - 1 에서 3 까지 (총 3 중에서)
-
글쓴이글
-
2024년 2월 16일 13:44 #113437
조승엽참가자그림처럼 ::before 밑에 있는 글씨를 가져오려면 어떻게 하죠? 저 글씨에 직접 copy element하면 그냥 저 글씨 뜨고, xpath나 그런걸로도 시도해보니 안되더라고요.
2024년 2월 16일 13:58 #113441
조승엽참가자DevTools listening on ws://127.0.0.1:58283/devtools/browser/cefa464f-464e-44a9-a9c1-4dc5a2629812 Traceback (most recent call last): File "C:\coding\crawling\instagram_re\app.py", line 12, in <module> zz = driver.find_element(By.CSS_SELECTOR,'#mount_0_0_Vr > div > div > div.x9f619.x1n2onr6.x1ja2u2z > div > div > div.x78zum5.xdt5ytf.x1t2pt76.x1n2onr6.x1ja2u2z.x10cihs4 > section > main > article > div._ab1y > div.x78zum5.xdt5ytf > div._aa4u > span').text ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 741, in find_element return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 347, in execute self.error_handler.check_response(response) File "C:\Python312\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"#mount_0_0_Vr > div > div > div.x9f619.x1n2onr6.x1ja2u2z > div > div > div.x78zum5.xdt5ytf.x1t2pt76.x1n2onr6.x1ja2u2z.x10cihs4 > section > main > article > div._ab1y > div.x78zum5.xdt5ytf > div._aa4u > span"} (Session info: chrome=121.0.6167.185); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception Stacktrace: GetHandleVerifier [0x00B81673+52979] (No symbol) [0x00B07961] (No symbol) [0x009EDD3D] (No symbol) [0x00A25FBB] (No symbol) [0x00A260FB] (No symbol) [0x00A5CF92] (No symbol) [0x00A44534] (No symbol) [0x00A5B3FE] (No symbol) [0x00A44286] (No symbol) [0x00A1C063] (No symbol) [0x00A1CECD] GetHandleVerifier [0x00E98D83+3294723] GetHandleVerifier [0x00ED6CC2+3548482] GetHandleVerifier [0x00ED1C9C+3527964] GetHandleVerifier [0x00C1870E+671630] (No symbol) [0x00B11EB4] (No symbol) [0x00B0D808] (No symbol) [0x00B0D92D] (No symbol) [0x00AFF7E0] BaseThreadInitThunk [0x7780FCC9+25] RtlGetAppContainerNamedObjectPath [0x77A77C5E+286] RtlGetAppContainerNamedObjectPath [0x77A77C2E+238]
이런 에러가 떠요.
2024년 2월 16일 18:37 #113467
codingapple키 마스터span 태그 찾아서 안의 글자만 가져오면 됩니다 .find_elements(By.CSS_SELECTOR,'span.x1lliihq') 이런걸로 찾아봅시다
-
글쓴이글
3 글 보임 - 1 에서 3 까지 (총 3 중에서)
- 답변은 로그인 후 가능합니다.