How to Extract Hidden Links from Angular Sites?

0
0
Asked By CuriousCoder42 On

Hey everyone! I'm working on a web project where I need to grab links from a website that hides its hyperlinks. When I inspect the code, I see the `href` attribute as `ng-click="gotoExternalURL(usefulink.Website_URL)"`. Is there an efficient way to extract these URLs from the code? I could click the buttons and copy the URLs from the opened tabs, but given there are hundreds of these hidden links, I'm looking for a faster solution. Any ideas? Thanks!

3 Answers

Answered By CodeExplorer21 On

It's not that the links are hidden; they're just managed by Angular. A regex can help you out. If you're comfortable, using a browser automation tool like Selenium or Puppeteer might be your best bet to automate the clicking and URL extraction.

CuriousCoder42 -

Thanks for the suggestion! I was thinking about Selenium too. I'll give JavaScript a go as well.

Answered By TechWhiz07 On

You might want to consider using regular expressions and some JavaScript techniques. You can store the elements you find and extract the links from them.

Answered By DevGuru99 On

Make sure you're looking at the right code. The `ng-click` you see is part of Angular's handling, which won't show you links in the browser context. You might be inspecting the wrong part of the page.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.