Created
January 12, 2021 16:25
-
-
Save saasindustries/8cd59254398ebb253c061f4bc474fc7f to your computer and use it in GitHub Desktop.
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
| const request = require("request"); | |
| const cheerio = require("cheerio"); | |
| function proxyGenerator() { | |
| let ip_addresses = []; | |
| let port_numbers = []; | |
| let proxy; | |
| request("https://sslproxies.org/", function(error, response, html) { | |
| if (!error && response.statusCode == 200) { | |
| const $ = cheerio.load(html); | |
| $("td:nth-child(1)").each(function(index, value) { | |
| ip_addresses[index] = $(this).text(); | |
| }); | |
| $("td:nth-child(2)").each(function(index, value) { | |
| port_numbers[index] = $(this).text(); | |
| }); | |
| } else { | |
| console.log("Error loading proxy, please try again"); | |
| } | |
| ip_addresses.join(", "); | |
| port_numbers.join(", "); | |
| //console.log("IP Addresses:", ip_addresses); | |
| //console.log("Port Numbers:", port_numbers); | |
| |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment