This file contains 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 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.common.keys import Keys | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
# initialize webdriver | |
PATH = "C:\Program Files (x86)\chromedriver.exe" | |
driver = webdriver.Chrome(PATH) | |
This file contains 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 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 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 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 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 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 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 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 axios = require('axios'); | |
const cheerio = require('cheerio'); | |
//performing a GET request | |
axios.get('https://www.forextradingbig.com/instaforex-broker-review/') | |
.then(response => { | |
//handling the success | |
const html = response.data; |
OlderNewer