in reply to Re^2: Selenium::Firefox: problem finding a child_element
in thread Selenium::Firefox: problem finding a child_element

Glad to see one of my suggestions led to a solution. :-)

As to your additional questions, I'm unfortunately strapped for time (due to airlines still unwilling to tailor their flight plans to my personal needs). Here's some hurried (and untested) suggestions.

From the Abbreviated Syntax link I provided above, see

A recent post I made (Re^2: Trouble capturing multiple groupings in regex) has some additional XPath examples. In particular, see the "more involved for loop" (in the spoiler) for printing an entire element.

— Ken

Replies are listed 'Best First'.
Re^4: Selenium::Firefox: problem finding a child_element
by samberman (Novice) on Dec 22, 2015 at 19:16 UTC

    Thank you once again.

    After printing the element (on 2nd problem now), I realized that there was more than one of this type so I retrieved them as an array and went through until I found one with matching text. Then I looked more carefully at the child element and went to the root.... $child = $firefox->find_child_element($matched_parent, "./li/a/span[\@class='option']");

    The one I want, "Near Mint" is the first one that should match all that. When I retrieve the text (get_text), it retrieves nothing, but when I click it, it did select it and that is what I am after. I may wish to experiment with find_child_elements to see if there is some data there to ensure a match, but for now; I have working code.

    Thanks again. The perlmonks -- A valuable place for all of us!

      hello! perlquote! xpathquote! perlsinglequotes! :D!
      './i/a/span[@class="option"]' q{./i/a/span[@class="option"]} q{ ./i /a /span[ @class = 'option' ] }
      perlmonks! excited!