I scrapping the marketplace from this URL https://www.tokopedia.com/sunxin

I want to get the data from the button called Info Toko, if user click this will shown a pop up content: enter image description here enter image description here

The original source code for this button is:

<button class="css-rhf1fq-unf-btn e1ggruw00"><span>Info Toko</span></button>

I've tried to get the element by xpath, classname, link text, but still not working.

driver.find_element_by_link_text('Info Toko')

Always get error message like this enter image description here

Any ideas how to get this element?


2 Answers 2


Try by using xpath selector

In which you want to change your selector code as shown below


This will work


When ever you use a method read its documentation :


continue_link = driver.find_element_by_link_text('Continue')
continue_link = driver.find_element_by_partial_link_text('Conti')

This two element locators identifies the element only using link text.

In selenium a link is "an anchor tag" , an anchor tag is used wrap a href link

in your case its a button tag and not a anchor 'a' tag, so link text method won't work

use xpath , css or class


driver.find_element_by_xpath('//button[text()="Info Toko"]')


css to find using class



driver.find_element_by_class_name('css-rhf1fq-unf-btn e1ggruw00')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.