Find element by text in tag

paveltr

I am trying to parse some sites and have faced a problem with finding an element with xpath.

Do you know if there could be problems if the text you want to specify in xpath is not in English but e.g. in Russian?

let's say i want to find by such xpath

//*input[@value="text in Russian"]

Do I need to decode something or it is supposed to work and I need to solve the other problem??

update

It doesn't work even with explicit declaring like

'//*input[@value="%s"]' % u'text in Russian'

I will keep looking for other reasons.

Thx to all

paveltr

So, my problem was not with decoding but with specifying the full xpath to the element.

I spotted that for pages with complex structure partial xpath work not so good and not always.

In my case it is like:

//form[@id="basket-form"]/div/div[@class="content-top-secondary-section"]/div/div/div[@data-id="price-summary"]/div/div/input[@value="text in Russian"]

Intead of initial simple declaration of the last part

//input[@value="text in Russian"]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

find the <a> tag by text of the href

From Dev

Find Element wrapped in a HTML tag

From Dev

JavaScript find element by text

From Dev

python selenium find element by tag inside a div (has no name, class, id or text)

From Dev

(Python) How to use driver.find_element_by_link_text when two texts are there in between <a> tag

From Dev

Beautifulsoup: How to find a string if tag or element not known?

From Dev

Protractor find an element by tag inside a div

From Dev

mysql query to find html tag element in database

From Dev

Javascript: Find value of an element in tag by classname

From Dev

find the end tag of html element in javascript

From Dev

Selenium: find element by visible Text

From Dev

Selenium: find element by visible Text

From Dev

Find element which contains text

From Dev

Selenium find element by text with &#65279?

From Dev

Emmet abbreviations- text inside an element tag

From Dev

Wrap part of text into new element tag

From Dev

justified text in anchor tag of list element

From Dev

Extracting text from BeautifulSoup tag element

From Dev

Find Element Next to Element With Specified Text

From Dev

<div> tag disappears under a floated element, but a <p> tag or text does not?

From Dev

Beautifulsoup can't find tag by text

From Dev

Javascript find all text except those in <a> tag

From Dev

How to find closest tag to inner text

From Dev

Find index of tag with certain text in beautifulsoup/python

From Dev

Regex PHP: find text after certain tag

From Dev

How to find xml element with using element tag in android

From Dev

Find the first element with a certain class/tag name after another element

From Dev

Find parent Tag based on multiple tag text - BeautifulSoup

From Dev

angular.element(id).find() is not able to find a child tag

Related Related

  1. 1

    find the <a> tag by text of the href

  2. 2

    Find Element wrapped in a HTML tag

  3. 3

    JavaScript find element by text

  4. 4

    python selenium find element by tag inside a div (has no name, class, id or text)

  5. 5

    (Python) How to use driver.find_element_by_link_text when two texts are there in between <a> tag

  6. 6

    Beautifulsoup: How to find a string if tag or element not known?

  7. 7

    Protractor find an element by tag inside a div

  8. 8

    mysql query to find html tag element in database

  9. 9

    Javascript: Find value of an element in tag by classname

  10. 10

    find the end tag of html element in javascript

  11. 11

    Selenium: find element by visible Text

  12. 12

    Selenium: find element by visible Text

  13. 13

    Find element which contains text

  14. 14

    Selenium find element by text with &#65279?

  15. 15

    Emmet abbreviations- text inside an element tag

  16. 16

    Wrap part of text into new element tag

  17. 17

    justified text in anchor tag of list element

  18. 18

    Extracting text from BeautifulSoup tag element

  19. 19

    Find Element Next to Element With Specified Text

  20. 20

    <div> tag disappears under a floated element, but a <p> tag or text does not?

  21. 21

    Beautifulsoup can't find tag by text

  22. 22

    Javascript find all text except those in <a> tag

  23. 23

    How to find closest tag to inner text

  24. 24

    Find index of tag with certain text in beautifulsoup/python

  25. 25

    Regex PHP: find text after certain tag

  26. 26

    How to find xml element with using element tag in android

  27. 27

    Find the first element with a certain class/tag name after another element

  28. 28

    Find parent Tag based on multiple tag text - BeautifulSoup

  29. 29

    angular.element(id).find() is not able to find a child tag

HotTag

Archive