Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7543837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:31:52+00:00 2026-05-30T08:31:52+00:00

I has a page as follow: <table> <tr> <th>Company Name</th> </tr> <tr> <td><a href=www.whatever.com>

  • 0

I has a page as follow:

<table>
<tr>
    <th>Company Name</th>
</tr>
<tr>
    <td><a href="www.whatever.com"> What Ever Company</a></td>
</tr>
</table>

The company name is placed arbitrary in the table, so I can only use the link’s text to locate the link:

selenium.click("link='What Ever Company'");

However, it says: ERROR:Element link='What Ever Company' not found.

What is the problem here? Is there any other way to click on the link?

Many thanks.

EDIT
Seem that the problem is I have several links with the same text (my bad). After making the link’s text unique, I use selenium.click("//a[contains(text(),'Test Campaign 1756237989')]") and it works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:31:54+00:00Added an answer on May 30, 2026 at 8:31 am

    Could this be because you’re forgetting the space at the start of the link?

    selenium.click("link=' What Ever Company'");
                          ^
    

    Another possible way of clicking the link, is to use an XPath expression:

    selenium.click("//a[contains(.,'What Ever Company')]");
    

    This will match all links with ‘What Ever Company’ in it.

    If you want it more exact:

    selenium.click("//a[.=' What Ever Company']");
    

    This will only match if the anchor equals ‘ What Ever Company’.

    Another option is to make the search more specific (i.e. tell the locator this link is always inside a <td> with an <a> inside):

    selenium.click("//td[a]/a[contains(.,'What Ever Company')]");
    

    The //td[a] looks for all <td> elements with <a> inside. (Differs from //td/a in that if you look for elements with //td[a][2] you get the second <a> which is inside a <td>, while //td/a[2] on the other hand gets the second <a> of the first <td>.)

    EDIT: I thought using . as a reference to text() in the XPath expressions should work, but if it doesn’t, try using text() instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HTML page with about 50 tables on it. Each table has
I'm developing web page which has main file index.php as follows: include('UserClass.php'); include('html/top.php'); $user
I have a custom view, that has page and block. But the problem when
This page has been quite confusing for me. It says: Memory management in newLISP
The page has a container div which holds multiple content divs. Each content div
my Page has many hover images, sometimes there are backgrounds from div-elements or src
Page has menu items that would replace a 'div id=foo_(current menu item)' with 'div
My page has about 25 radio button groups. When a radio button is selected
Main page has a gridview with options to filter / search etc... when a
My page has 3 divs that are located horizontally. I need to make the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.