in reply to Clicking a link with perl with no VALUE, ID or NAME in perl Selenium 1
#$sel->click("xpath=//imgcontains($addcardlink)"); #$sel->click("xpath=//input@src=$addcardlink");
Neither of these two string expressions would be a valid XPath expression. And you conveniently also hide the value of $addcardlink from us. I get the feeling that you are not doing any work of your own and expect us to do your work for you, as your question has nothing to do with Perl and everything to do with learning XPath.
I recommend using a browser plugin like XPather or Firebug. These plugins will show you a valid XPath expression to reach your element.
Consider slowly refining your XPath expressions. First, start with an XPath expression that finds all a links. Then refine that expression to find all a links that contain an img image element. Next, refine the expression more, to match only links with an image whose src element contains() a certain string.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |