I'm trying to click a search button with the help of selenium webdriver and python
Here is the HTML Code
<button data-testid="search-button" tabindex="4" type="submit" class="sc-2ry4jn-0
sc-2ry4jn-2 sc-17kxwsy-0 bWjDpN" xpath="1"><div data-testid="icon-testid" class="sc-
121424n-0 loEDwb"><div class="sc-121424n-2 jFTWvP"><span class="sc-1kvy6kt-0 jTNjLr sc-
121424n-3 gCitZe" data-testid="icon:icon-jameda-SVG-icon-Search" color="#fff"><svg><use data-testid="svgcontainer-use" xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="#icon-jameda-SVG-icon-Search"></use></svg></span></div><div color="#fff" class="sc-121424n-1 hGbob">Suchen</div></div></button>
<div data-testid="icon-testid" class="sc-121424n-0 loEDwb" xpath="1"><div class="sc-
121424n-2 jFTWvP"><span class="sc-1kvy6kt-0 jTNjLr sc-121424n-3 gCitZe" data-
testid="icon:icon-jameda-SVG-icon-Search" color="#fff"><svg><use data-
testid="svgcontainer-use" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-
jameda-SVG-icon-Search"></use></svg></span></div><div color="#fff" class="sc-121424n-1
hGbob">Suchen</div></div>
<div class="sc-121424n-2 jFTWvP" xpath="1"><span class="sc-1kvy6kt-0 jTNjLr sc-121424n-3
gCitZe" data-testid="icon:icon-jameda-SVG-icon-Search" color="#fff"><svg><use data-
testid="svgcontainer-use" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-
jameda-SVG-icon-Search"></use></svg></span></div>
<span class="sc-1kvy6kt-0 jTNjLr sc-121424n-3 gCitZe" data-testid="icon:icon-jameda-SVG-
icon-Search" color="#fff" xpath="1"><svg><use data-testid="svgcontainer-use"
xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-jameda-SVG-icon-Search">
</use></svg></span>
To see the whole HTML Code visit: www.jameda.de and check out the green search button in the right corner
I already tried to click it via CLASS_NAME
, XPATH
, LINK_TEXT
but I always get the following error.
no such element: Unable to locate element:
Here is my code I used so far:
driver.find_element(by=By.CLASS_NAME, value="sc-2ry4jn-0 sc-2ry4jn-2 sc-17kxwsy-0 bWjDpN").click()
The button is visible when trying to click it.