Skip to content

Instantly share code, notes, and snippets.

@manojsinghnegiwd
Created June 1, 2021 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manojsinghnegiwd/bc752143ee46353f06e03bc295c25842 to your computer and use it in GitHub Desktop.
Save manojsinghnegiwd/bc752143ee46353f06e03bc295c25842 to your computer and use it in GitHub Desktop.
const puppeteer = require('puppeteer');
const googleSearch = async () => {
const browser = await puppeteer.launch({
headless: false
});
const page = await browser.newPage();
await page.viewport({
width: 1920,
height: 1080
})
await page.goto("https://www.google.com")
await page.type('[aria-label="Search"]', "steve jobs")
const element = await page.$('[aria-label="Search"]')
await element.press('Enter');
}
googleSearch();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment