Groups
Groups
Sign in
Groups
Groups
Selenium Users
Conversations
Labels
About
Send feedback
Help
Using xpath to get Link anchor text?
346 views
Skip to first unread message
arya
unread,
Sep 28, 2009, 8:26:10 PM
9/28/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to selenium-users...@googlegroups.com
Hello
Lets say we have some html like the following
<html>
<head> <title>Main</title></head>
<body>
<a href="page.html">TEXT LINK</a>
</body>
<html>
Would it be possible to extract "TEXT LINK" using xpath?
Best Regards
rajiv
unread,
Sep 28, 2009, 11:54:06 PM
9/28/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to selenium-users...@googlegroups.com
Try to use This
{code:html}<tr>
<td>storeText</td>
<td>//a[contains(@href, 'page.html')]</td>
<td>linkname</td>
</tr>
<tr>
<td>echo</td>
<td>{code}${linkname}</td>
<td></td>
</tr>
storeText | //a[contains(@href, 'page.html')] | linkname
echo | ${linkname}
arya
unread,
Sep 29, 2009, 4:22:04 PM
9/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to selenium-users...@googlegroups.com
Thanks, but I forgot to mention that I'm using Perl with selenium [
http://search.cpan.org/~lukec/Test-WWW-Selenium/lib/WWW/Selenium.pm
] and there is no "storeText" method in the perl module. Is there anyway to do it in Perl?
Reply all
Reply to author
Forward
0 new messages