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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:34:14+00:00 2026-06-15T11:34:14+00:00

This is a common question to a problem that I have been able to

  • 0

This is a common question to a problem that I have been able to mitigate up until now.

Given that the dynamic html/php is heavy with dependencies and is as such unchangeable.

My page source looks like so

 <div id="unique">
    <div id="ambiguous">
       <a href="EditMS(unique record num)">Edit</a> <!--Javascript-->
    </div>
    <div id="ambiguous">
       <a href="EditApple(unique record num)">Edit</a> <!--Javascript-->    
    </div>
 </div>

I’ve had ambiguous issues in the past and have been able to mitigate them by executing the underlying javascript but feel now that I cannot because of the dynamic record numbers.

Question one: Can I use xpath or some such to access the correct Edit link?
Question two: Can I somehow get the dynamic record number, and then execute the javascript?

  • 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-06-15T11:34:16+00:00Added an answer on June 15, 2026 at 11:34 am

    There are a couple ways to do it with css. You can grab all of the matching ids, or if the link hrefs are always like that, you can use css attribute matching. For instance:

    find('#unique').all('#ambiguous').each do |ambiguous| 
      # conditions in here
    end
    

    Or you can use ^= for match beginning, *= for match somewhere, and $= for match end

    find('a[href^="Edit"]') or find('a[href*="Apple"]')

    Hope that helps. I see a regex to get the value in your near future. Like:

    "EditApple293845093405983049".match(/\d+/)[0]
    # => 293845093405983049
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this question is about style, because i think this is a very common problem
I have this common issue of 'new line' in php-csv which is making me
I have been reviewing algorithms, this is question from Anany Levitin's algo book.. You
I hope that I have titled this question appropriately. Bit of a mixed subject
I've searched all over and couldn't find an answer to this seemingly common question,
This is a common question, but the explanations found so far and observed behaviour
I know this is a common question and there are oodles of resources on
I am sure this is a common question, but since I'm really new to
Firstly sorry if this is a common question but I couldn't find anything on
I think this is a fairly common question: how to put my business logic

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.