segment-boneyard / nightmare

A high-level browser automation library.
https://open.segment.com
19.54k stars 1.08k forks source link

DuckDuckGo example not working #1601

Open adams-family opened 4 years ago

adams-family commented 4 years ago

Hi,

it seems to me that the DuckDuckGo example from the main MD document is not working:

const nightmare = Nightmare({ show: true })

nightmare
  .goto('https://duckduckgo.com')
  .type('#search_form_input_homepage', 'github nightmare')
  .click('#search_button_homepage')
  .wait('#r1-0 a.result__a')
  .evaluate(() => document.querySelector('#r1-0 a.result__a').href)
  .end()
  .then(console.log)
  .catch(error => {
    console.error('Search failed:', error)
  })

This does nothing at all - no output, no error message.

Running in Docker CE and Node 10.8.

Dockerfile:


WORKDIR /usr/src/app

CMD [ "node", "index.js" ]
shashanka2a commented 4 years ago

Check your Electron path once and Did u import nightmare?