Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Clicking a link with perl with no VALUE, ID or NAME in perl Selenium 1

by Corion (Patriarch)
on Oct 18, 2011 at 16:28 UTC ( [id://932191]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://932191]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-23 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found