1

I was trying to extract the URLs of certain links on a webpage, using this:

var links = document.querySelectorAll('a[href*="whatever"]');
for(var i = 0; i < links.length; i++){
  console.log(links[i].href);
};

While this works well on Chrome, Firefox shortens the URLs with '...' in console, and trying to save the console content to a file uses the shortened URLs, so not useful:

enter image description here

Any idea on how to fix this?

4
  • Can it be that the console is truncating only visually because the string is too long? Dec 27, 2022 at 18:45
  • See Long strings that begin with ‘http’ truncated. Right-click → Copy link location. @HarunYilmaz Only long URLs are truncated. Dec 27, 2022 at 18:46
  • @HarunYilmaz No, it's not just the visual presentation, using "Copy Message" or "Save all messages to file" will include the '...' Dec 28, 2022 at 19:13
  • @SebastianSimon Yeah, but the whole purpose of doing this was about automating the procedure, and doing this for each entry doesn't make sense... My task is already done in Chrome, I just wanted to see if I can make Firefox to do it as well. Thanks! 👍 Dec 28, 2022 at 19:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.