interface Example { title : string ; code : string ; } const examples = [ { title : 'Screenshot' , code : `\
const chromeless = new Chromeless({ remote: true })

const screenshot = await chromeless
  .goto('https://www.graph.cool')
  .scrollTo(0, 2000)
  .screenshot()

console.log(screenshot)

await chromeless.end()` , } , { title : 'Google Search Screenshot' , code : `\
const chromeless = new Chromeless({ remote: true })

const screenshot = await chromeless
  .goto('https://www.google.com')
  .type('chromeless', 'input[name="q"]')
  .press(13)
  .wait('#resultStats')
  .screenshot()
  .scrollTo(0, 1000)

console.log(screenshot)

await chromeless.end()` , } , { title : 'Extract Google Search Results' , code : `\
  const chromeless = new Chromeless({ remote: true })

const links = await chromeless
  .goto('https://www.google.com')
  .type('chromeless', 'input[name="q"]')
  .press(13)
  .wait('#resultStats')
  .evaluate(() => {
    // this will be executed in headless chrome
    const links = [].map.call(
      document.querySelectorAll('.g h3 a'),
      a => ({title: a.innerText, href: a.href})
    )
    return JSON.stringify(links)
  })
  // you can still use the method chaining API after evaluating
  // when you're done, at any time you can call \`.then\` (in our case \`await\`)
  .scrollTo(0, 1000)

console.log(links)

await chromeless.end()` } ] ; export default examples ;