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 the required libraries | |
const { Builder } = require('selenium-webdriver'); | |
const chrome = require('selenium-webdriver/chrome'); | |
// set the path to udetected_chromedriver executable file | |
const chromeDriverPath = 'C:/Users/dell/AppData/Roaming/undetected_chromedriver/undetected_chromedriver.exe'; | |
// set the path to your actual Chrome browser executable file | |
const chromeExePath = 'C:/Program Files/Google/Chrome/Application/chrome.exe'; |
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
pip install undetected-chromedriver |
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
<!DOCTYPE html> | |
<!-- ... --> | |
<head> | |
<title>Asana Reviews 2024</title> | |
</head> | |
<body> | |
<!-- ... other page content ignored for brevity --> |
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 axios | |
const axios = require('axios'); | |
const url = 'https://www.g2.com/products/asana/reviews'; | |
axios({ | |
url: 'https://api.zenrows.com/v1/', | |
method: 'GET', | |
params: { | |
'url': url, |
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
<!DOCTYPE html> | |
<html class="no-js" lang="en-US"> | |
<head> | |
<title>Attention Required! | Cloudflare</title> | |
</head> | |
<body> | |
<!-- ... other page content ignored for brevity --> | |
</body> | |
</html> |
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 the required libraries | |
const { Builder } = require('selenium-webdriver'); | |
const chrome = require('selenium-webdriver/chrome'); | |
// set the path to udetected_chromedriver executable file | |
const chromeDriverPath = 'C:/Users/dell/AppData/Roaming/undetected_chromedriver/undetected_chromedriver.exe'; | |
// set the path to your actual Chrome browser executable file | |
const chromeExePath = 'C:/Program Files/Google/Chrome/Application/chrome.exe'; |
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
// ... | |
// navigate to a website | |
async function scraper() { | |
try { | |
await driver.get('https://www.g2.com/products/asana/reviews'); | |
// extract the page HTML | |
const pageSource = await driver.getPageSource(); | |
console.log('Page HTML:', pageSource); |
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
// ... | |
// create a new WebDriver instance | |
const driver = new Builder() | |
.forBrowser('chrome') | |
.setChromeOptions(chromeOptions) | |
.setChromeService(new chrome.ServiceBuilder(chromeDriverPath)) | |
.build(); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>nowSecure</title> | |
</head> | |
<body> | |
<!-- ... --> | |
<h1>OH YEAH, you passed!</h1> |
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 the required libraries | |
const { Builder } = require('selenium-webdriver'); | |
const chrome = require('selenium-webdriver/chrome'); | |
// set the path to udetected_chromedriver executable file | |
const chromeDriverPath = 'C:/Users/dell/AppData/Roaming/undetected_chromedriver/undetected_chromedriver.exe'; | |
// set the path to your actual Chrome browser executable file | |
const chromeExePath = 'C:/Program Files/Google/Chrome/Application/chrome.exe'; |
NewerOlder