Merhabalar,
Python selenium ile bir websitesini açmak ve web sitesindeki searchboxa ulaşmak istiyorum. Xpath ve türlülerini defalarca denememe rağmen bir türlü başaramadım.
Aşağıda kodu, html kısmını ve hatayı ekliyorum. Lütfen yardımcı olabilir misiniz.
Kod:
search_box = browser.find_element(By.XPATH, “(//input[@placeholder=‘Search coin, pair, contract address, exchange, or post’])[1]”)
html search box:
Aldığım hata:
search_box = browser.find_element(By.XPATH, “(//input[@placeholder=‘Search coin, pair, contract address, exchange, or post’])[1]”)
File “C:\Users\furka\Desktop\GokhanAbiDenemeler\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 742, in find_element
return self.execute(Command.FIND_ELEMENT, {“using”: by, “value”: value})[“value”]
File “C:\Users\furka\Desktop\GokhanAbiDenemeler\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 348, in execute
self.error_handler.check_response(response)
File “C:\Users\furka\Desktop\GokhanAbiDenemeler\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”:“xpath”,“selector”:“(//input[@placeholder=‘Search coin, pair, contract address, exchange, or post’])[1]”}
(Session info: chrome=120.0.6099.130); For documentation on this error, please visit: Understanding Common Errors | Selenium
Stacktrace:
GetHandleVerifier [0x00007FF62B842142+3514994]
(No symbol) [0x00007FF62B460CE2]
(No symbol) [0x00007FF62B3076AA]
(No symbol) [0x00007FF62B351860]
(No symbol) [0x00007FF62B35197C]
(No symbol) [0x00007FF62B394EE7]
(No symbol) [0x00007FF62B37602F]
(No symbol) [0x00007FF62B3928F6]
(No symbol) [0x00007FF62B375D93]
(No symbol) [0x00007FF62B344BDC]
(No symbol) [0x00007FF62B345C64]
GetHandleVerifier [0x00007FF62B86E16B+3695259]
GetHandleVerifier [0x00007FF62B8C6737+4057191]
GetHandleVerifier [0x00007FF62B8BE4E3+4023827]
GetHandleVerifier [0x00007FF62B5904F9+689705]
(No symbol) [0x00007FF62B46C048]
(No symbol) [0x00007FF62B468044]
(No symbol) [0x00007FF62B4681C9]
(No symbol) [0x00007FF62B4588C4]
BaseThreadInitThunk [0x00007FF9A7AD257D+29]
RtlUserThreadStart [0x00007FF9A988AA58+40]
Class ile placeholder ile ve input ile denedim hepsinde aynı hatayı alıyorum