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
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.
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.
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.
Thanks for the suggestion! I was thinking about Selenium too. I'll give JavaScript a go as well.