Last active
December 5, 2023 15:25
-
-
Save mikedigriz/d3d723751fc381cf04af4f7a20683dfe to your computer and use it in GitHub Desktop.
hidemy.io proxy parser
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
// Open site and paste to F12 console | |
// https://hidemy.io/ru/proxy-list/?country=RU&maxtime=100&type=hs#list | |
var proxyListTable = []; | |
var tableRows = document.querySelectorAll(".table_block > table:nth-child(1) > tbody:nth-child(2) > tr"); //table rows | |
var result = ""; | |
// | |
for (let i = 0; i < tableRows.length; i++) { | |
proxyListTable[i] = []; | |
for (let k = 0; k < tableRows[0].cells.length; k++) { | |
proxyListTable[i][k] = tableRows[i].cells[k].innerText; | |
} | |
} | |
proxyListTable.sort(function (x, y) { | |
return x[3].match(/\d+/g) - y[3].match(/\d+/g); | |
}); | |
console.table(proxyListTable); | |
for (let i = 0, f = 0; i < tableRows.length; i++) { | |
if (parseInt(proxyListTable[i][3].match(/\d+/g)) !== 0 ) { | |
f += 1; | |
result += `${proxyListTable[i][0]}:${proxyListTable[i][1]}` + ((i < (tableRows.length - 1)) ? "\n" : ""); | |
} | |
} | |
console.log(result); | |
function downloadContent(name, content) { | |
var atag = document.createElement("a"); | |
var file = new Blob([content], {type: 'text/plain'}); | |
atag.href = URL.createObjectURL(file); | |
atag.download = name; | |
atag.click(); | |
} | |
downloadContent("proxy.txt", result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment