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
/** | |
* Amazon product search automation | |
* @author - http://www.softwaretestingtipsandtricks.com/ | |
*/ | |
const puppeteer = require('puppeteer') | |
const chai = require('chai'); | |
const { expect, assert } = require('chai'); | |
const URL = "https://www.amazon.com/"; | |
const selectors = { |
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 puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto(‘http://www.softwaretestingtipsandtricks.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
const puppeteer = require('puppeteer') | |
const fs = require('fs') | |
const path = require('path') | |
const { promisify } =require ('util') | |
const readFileAsync = promisify(fs.readFile) | |
const writeFileAsync = promisify(fs.writeFile); | |
(async () => { | |
const browser = await puppeteer.launch({}) | |
const page = await browser.newPage() |
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 puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch({ devtools: true }); | |
const page = await browser.newPage(); | |
// Grants permission for changing geolocation | |
const context = browser.defaultBrowserContext(); | |
await context.overridePermissions('https://www.google.com/', ['geolocation']); |