This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source https://towardsdatascience.com/quickly-extract-all-links-from-a-web-page-using-javascript-and-the-browser-console-49bb6f48127b | |
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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import gzip | |
import requests | |
from StringIO import StringIO | |
# Parameters | |
prefix = 'https://commoncrawl.s3.amazonaws.com/' | |
fileout_extension = "pdf" | |
def get_file(warc_filename, warc_record_offset, warc_record_length, content_digest): |