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 455919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:25:10+00:00 2026-05-12T22:25:10+00:00

I have the following XPath: //div[contains(@id, ‘box’)]/div/h4/small/a[contains(@href, ‘google’)]/@href When I try out this XPath

  • 0

I have the following XPath:

//div[contains(@id, 'box')]/div/h4/small/a[contains(@href, 'google')]/@href

When I try out this XPath in XPath Checker (Firefox extension), it works perfectly all the time. But when I do the following in Selenium:

System.out.println(selenium.getAttribute("//div[contains(@id, 'box')]/div/h4/small/a[contains(@href, 'google')]/@href"));

It keeps giving me the following log error:

14:30:56.311 INFO - Got result: OK on session 5a1401d374a04779bbe6f7fe9a0b4536
14:30:56.315 INFO - Command request: getAttribute[//div[contains(@id, 'box')]/div/h4/small/a[contains(@href, 'google')]/@href, ] on session 5a1401d374a04779bbe6f7fe9a0b4536
14:30:56.372 INFO - Got result: ERROR: Element //div[contains(@id, 'box')]/div/h4/small/a[contains(@href, 'google')]/ not found on session 5a1401d374a04779bbe6f7fe9a0b4536

I am going crazy to solve this problem. Does anyone see any mistake that I have in my code line?

  • 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-12T22:25:10+00:00Added an answer on May 12, 2026 at 10:25 pm

    Shouldn’t that query string look like this (according to javadoc api)?

    "xpath=//div[contains(@id, 'box')]/div/h4/small/a[contains(@href, 'google')]/@href"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following XPath to match authors name in an Amazon page: //div[@class='pTitle']/span[@class='small
i have the following code to for xpath query... <div class=buying> <h1 class=parseasinTitle >
I have the following node /html[1]/body[1]/div[1]/div[1]/div[3]/div[1]/div[7]/p[1]/#text[1] How can I figure out that the last
I have the following HTML: <div class=top> <p>Blah.</p> I want <em>this</em> text. </div> What
I have the following HTML: <html> <head><title>Title</title></head> <body> <div id='div2'> <a href='#'>1</a> <div id='div1'>
I have the following xpath query which seems to be working but I just
I have the following XPATH line: //det[@nItem=1]/prod/cProd That successfully selects the desired node using
I have the following html and like to know how to use xpath to
I have following div in a page (I can not modify). <div id=:0.control>Click me</div>
I have the following xpath statement in a selenium test: //tbody/tr[td/span[text()='IPODate']]/td[4]/input It gets what

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.