Issue
I'm trying to find a text and click, but I don't know what's going on nothing that I try is working.
I've already tried:
driver.find_element(By.XPATH("//*[contains(text(),'Retenção colocada pelo sistema para reter documentos fiscais que requerem confirmação eletrônica. ')]")).click()
and
driver.find_elements_by_xpath("//*[contains(text(), 'Retenção colocada pelo sistema para reter documentos fiscais que requerem confirmação eletrônica. ')]")
I get this error: 'str' object is not callable
Solution
If you are searching by partial text - the best practice will be to ignore characters like dot (.), semi-colon (;) or apostrophe (').
driver.find_element(By.XPATH, "//*[contains(text(),'Retenção colocada pelo sistema para reter documentos fiscais')]").click()
Also ignore some of the words, up to 8 or 9 words is more than enough.
Answered By - Tal Angel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.