Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
Greasemonkey / Tampermonkey Create a link from text on an Amazon page

N00b to scripting so apologies in advance...
I am looking use TamperMonkey to create a link from text on a page where it will take the result and search for it against another website.

I'm looking to take the Trade Register Number, turn it into a link that takes that number and runs it against a UK HMRC website. The final link looking something like this: https://find-and-update.company-information.service.gov.uk/company/12345678/officers

Detailed Seller Information:
Business Name:Fake Name Ltd
Business Type:Privately-owned business
Trade Register Number:1234578
VAT Number:GB123456789

I've spend a couple of hours butchering snippets taken from here and everywhere else, and am no closer than when I started.
Any help would be greatly appreciated.

<div class="a-row a-spacing-medium">
  <div class="a-column a-span6">
    <hr aria-hidden="true" class="a-spacing-medium a-spacing-top-medium a-divider-normal">
    <h3 id="-component-heading" class="a-spacing-large">
      Detailed Seller Information
    </h3>
    <ul class="a-unordered-list a-nostyle a-vertical">
      <li><span class="a-list-item"><span class="a-text-bold">Business Name:</span>Fake Name Ltd</span>
      </li>
      <li><span class="a-list-item"><span class="a-text-bold">Business Type:</span>Privately-owned business</span>
      </li>
      <li><span class="a-list-item"><span class="a-text-bold">Trade Register Number:</span>12354678</span>
      </li>
      <li><span class="a-list-item"><span class="a-text-bold">VAT Number:</span>GB123456789</span>
      </li>
      <li><span class="a-list-item"><span class="a-text-bold">Phone number:</span>01234 567890</span>
      </li>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I haven't messed around with Greasemonkey or Tampermonkey too much, but as far as a simple script to convert those Trade Register Number values into URLs (following the format you provided), this should do the trick.

document.querySelector(".a-unordered-list.a-nostyle.a-vertical").querySelectorAll("li").forEach(el => {
    if(el.textContent.split(":")[0] == "Trade Register Number") {
        el.innerHTML = `<span class="a-text-bold">Trade Register Number:</span><a href="https://find-and-update.company-information.service.gov.uk/company/${el.textContent.split(":")[1]}/officers" target="_blank">${el.textContent.split(":")[1]}</a>`;
    }
});
<div class="a-row a-spacing-medium">
  <div class="a-column a-span6">
    <hr aria-hidden="true" class="a-spacing-medium a-spacing-top-medium a-divider-normal">
    <h3 id="-component-heading" class="a-spacing-large">
      Detailed Seller Information
    </h3>
    <ul class="a-unordered-list a-nostyle a-vertical">
      <li><span class="a-list-item"><span class="a-text-bold">Business Name:</span>Fake Name Ltd</span>
      </li>
      <li><span class="a-list-item"><span class="a-text-bold">Business Type:</span>Privately-owned business</span>
      </li>
      <li><span class="a-list-item"><span class="a-text-bold">Trade Register Number:</span>12354678</span>
      </li>
      <li><span class="a-list-item"><span class="a-text-bold">VAT Number:</span>GB123456789</span>
      </li>
      <li><span class="a-list-item"><span class="a-text-bold">Phone number:</span>01234 567890</span>
      </li>
    </ul>
  </div>
</div>

This will only run for 1 set of seller information. If there are multiple listed on the page, I would need to see the HTML for that to properly make it loop through all records on the page.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!