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

  • Home
  • SEARCH
  • 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 6964421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:55:20+00:00 2026-05-27T15:55:20+00:00

I have the following XPath to match attributes of the class span: //span[@class=’amount’] I

  • 0

I have the following XPath to match attributes of the class span:

//span[@class='amount']

I want to match all elements that have the class attribute of “amount” but also may have other classes as well. I thought I could do this:

//span[@class='*amount*'] 

but that doesn’t work…how can I do this?

  • 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-27T15:55:21+00:00Added an answer on May 27, 2026 at 3:55 pm

    Use the following expression:

    //span[contains(concat(' ', @class, ' '), ' amount ')]
    

    You could use contains on its own, but that would also match classes like someamount. Test the above expression on the following input:

    <root>
      <span class="test amount blah"/>
      <span class="amount test"/>
      <span class="test amount"/>
      <span class="amount"/>
      <span class="someamount"/>
    </root>
    

    It will select the first four span elements, but not the last one.

    • 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'm trying to use XPath to find all elements that have an element in
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 following script that executes all the .reg files in the current directory.
i have the following code to for xpath query... <div class=buying> <h1 class=parseasinTitle >
I have the following xpath statement in a selenium test: //tbody/tr[td/span[text()='IPODate']]/td[4]/input It gets what
I have the following html and like to know how to use xpath to
I have code that I expect to return the element name, but nothing is
I have the following XPath: //div[contains(@id, 'box')]/div/h4/small/a[contains(@href, 'google')]/@href When I try out this XPath

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.