StackHacks - Here's how to Extract URLs from a Webpage plus - Take a Full Page ScreenShot -all Free and Easy
Plus a bonus. You never know when you might want to use this stuff.
Code to extract URLs from a webpage. Free and easy.
Extract the URLs from: https://pau1.substack.com/p/200-marketing-options-for-2022
First, we want to open the developer console and run some JavaScript code right from your Chrome browser. No need to have coding software!
Right-click in the margin of the page you want to get the links from > choose “Inspect” or “Inspect Element”
The console opens up
Paste the code into the bottom box like this, then press enter:
The Code
var x = document.querySelectorAll("a");
var myarray = []
for (var i=0; i<x.length; i++){
var nametext = x[i].textContent;
var cleantext = nametext.replace(/\s+/g, ' ').trim();
var cleanlink = x[i].href;
myarray.push([cleantext,cleanlink]);
};
function make_table() {
var table = '<table><thead><th>Name</th><th>Links</th></thead><tbody>';
for (var i=0; i<myarray.length; i++) {
table += '<tr><td>'+ myarray[i][0] + '</td><td>'+myarray[i][1]+'</td></tr>';
};
var w = window.open("");
w.document.write(table);
}
make_table()
This is what we extracted, after selecting then copying and pasting the result here:
To use however you’d like. Put the output into a spreadsheet to get just the links column. Or display as above. (from towardsdatascience.com)
Or use a Chrome Browser Extension: linkgrabber
Bonus 1
How to Take a Full-Page Screenshot Without an Extension
Open Chrome's menu.
Head to More tools > Developer tools.
Click the three-dot icon from the top-right corner and select Run command. ...
Type ‘screenshot’ into the search box.
Select Capture full-size screenshot. > enter
With a Chrome Extension: GoFullPage Screen Capture
Bonus 2
Here’s a tip you can use: When I am doing research for an article, I often have up to 15 tabs open on my Chrome browser. You?
I have been using this extension called One Tab. It saves all the tabs as a webpage that I can access anytime - rather than making a bookmark folder…
One Tab Extension link: https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall?hl=en
From their Website:
Whenever you find yourself with too many tabs, click the OneTab icon to convert all of your tabs into a list. When you need to access the tabs again, you can either restore them individually or all at once. When your tabs are in the OneTab list, you will save up to 95% of memory because you will have reduced the number of tabs open in Google Chrome. Privacy assurance Information about your tabs are never transmitted or disclosed to the OneTab developers. The only exception to this is if you intentionally click on our 'share as a web page' feature that allows you to upload your list of tabs into a web page in order to share them with others. Tabs are never shared unless you specifically use the 'share as a web page' button. Additional Benefits Depending on how many scripts are running inside your tabs, moving them to OneTab can also speed up your computer by reducing the CPU load. We have also had reports that this also contributes to your computer resuming from sleep more quickly.
Thanks for reading! If you like this, consider supporting my work with a Like, or a Comment, or even a Share, if you’re feeling crazy.
The “Deplatformable Newsletter“ has been called “the most valuable free newsletter in the world”. (by my buddy, David).
Have you tried the “Sample” newsletter? I’ve had a bunch of subscribers from there.
Peace in Ukraine! ✌️
Hey thanks Paul for the heads up about Sample. I've registered so here's hoping!
One Tab is fantastic! I don’t know if it actually made my laptop run faster, but I sure was a lot less distracted!