0

I'm using SeleniumBase and I need to click on an element identified like this below:

<span class="text">
                Contato PF e PJ
            </span>

I need to catch by the text inside (Contato PF e PJ). How can I do this with SeleniumBase?

from seleniumbase import BaseCase

self.click(...

Michael Mintz
  • 9,007
  • 6
  • 31
  • 48

1 Answers1

1

find_element_by_xpath('//span[contains(text(), "Contato PF e PJ")]')

Dillon Miller
  • 763
  • 1
  • 6
  • 18
  • 2
    In that case, I just use self.click('//span[contains(text(), "Contato PF e PJ")]') and worked. I'm using SeleniumBase. Thanks! – Daniel Maia Jun 02 '20 at 18:26