Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial headless chrome implementation #1211

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ dependencies:
- sudo apt-get update; sudo apt-get install libnotify-bin
- npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
- nvm install 4; nvm install 5; nvm install 6
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- sudo apt-get update
- sudo apt-get --only-upgrade install google-chrome-stable
post:
- google-chrome --version

- google-chrome --headless --remote-debugging-port=9222 --disable-gpu:
background: true

test:
override:
Expand Down
3 changes: 2 additions & 1 deletion example.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
var Nightmare = require('nightmare');
var nightmare = Nightmare({ show: true })
var nightmare = new Nightmare();

nightmare
.goto('http://yahoo.com')
.type('form[action*="/search"] [name=p]', 'github nightmare')
.click('form[action*="/search"] [type=submit]')
.wait('#main')
.wait(1000)
.evaluate(function () {
return document.querySelector('#main .searchCenterMiddle li a').href
})
Expand Down
Loading