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 requests | |
| import csv | |
| APIKEY = 'YOUR API KEY HERE' | |
| NUM = 5 | |
| def check_urls(urls): | |
| headers = { | |
| 'apikey': APIKEY |
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
| from selenium import webdriver | |
| from selenium.webdriver.chrome.options import Options | |
| # other imports here | |
| options = Options() | |
| options.headless = True | |
| driver = webdriver.Chrome(CHROMEDRIVER_PATH, chrome_options=options) | |
| driver.get("https://www.reddit.com/") |
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
| from selenium import webdriver | |
| # other imports here | |
| PROXY = "127.63.13.19:3184" #HOST:PORT or IP:PORT | |
| chrome_options = webdriver.ChromeOptions() | |
| chrome_options.add_argument('--proxy-server=%s' % PROXY) | |
| chrome = webdriver.Chrome(options=chrome_options) | |
| chrome.get("https://www.reddit.com/") | |
| # more code here |
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
| for post in posts: | |
| header = post.find_element_by_tag_name("span") | |
| print(header.text) |
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
| ArrayList<String> hyperLinks = new ArrayList<String>(); | |
| // iterating and extracting | |
| for (Element e:pageElements) { | |
| hyperLinks.add("Text: " + e.text()); | |
| hyperLinks.add("Link: " + e.attr("href")); | |
| } | |
| for (String s : hyperLinks) { | |
| System.out.println(s); |
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 java.io.IOException; | |
| import java.util.ArrayList; | |
| import org.jsoup.Jsoup; | |
| import org.jsoup.nodes.Document; | |
| import org.jsoup.nodes.Element; | |
| import org.jsoup.select.Elements; | |
| public class myscrapy { |
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 java.io.IOException; | |
| import java.net.MalformedURLException; | |
| import com.gargoylesoftware.htmlunit.BrowserVersion; | |
| import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; | |
| import com.gargoylesoftware.htmlunit.WebClient; | |
| import com.gargoylesoftware.htmlunit.html.DomNode; | |
| import com.gargoylesoftware.htmlunit.html.DomNodeList; | |
| import com.gargoylesoftware.htmlunit.html.HtmlPage; |
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
| axios.get('https://www.forextradingbig.com/instaforex-broker-review/').then(response => { | |
| const html = response.data; | |
| }) |
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) { |
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
| def proxy_generator(): | |
| response = requests.get("https://sslproxies.org/") | |
| soup = BeautifulSoup(response.content, 'html5lib') | |
| proxy = {'https': choice(list(zip(map(lambda x:x.text, soup.findAll('td')[::8]), map(lambda x:x.text, soup.findAll('td')[1::8]))))))} | |
| return proxy |
OlderNewer