Comments (4)
That's weird. I'm running all this in Node 7.10.0, and I don't have that problem.
Where are you calling that fn? It needs to be inside an async fn. Something like this (assuming you've already initialized the browser):
async function navigateGoogle () {
await browser.goTo('www.google.com')
}
from simple-headless-chrome.
I can't test it on Windows, but for what I know so far, you're right. Just give it a try!
This module uses lighthouse's chromeLauncher, and it makes use of this file:
https://github.com/GoogleChrome/lighthouse/blob/v2.0.0/chrome-launcher/chrome-finder.ts
So, I think it should just work if your Chrome version is 59+
Please let me know if you could make it work, or if you need some help, so other people can benefit from your doubt :)
Cheers!
Luciano
from simple-headless-chrome.
Yes, You are right.
In Readme file you only mentioned about Mac and Linux.
So... Error that I got yesterday misleaded me to think there is no support for Windows.
Anyway - It's something with "await". I can't use await
.
Example error:
await browser.goTo('https://github.com/')
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:533:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
I have this error in NodeJS 8.0.0 and 7.10.0 (I didn't test in older versions).
Actions without "await" works fine when I use them in Node console.
from simple-headless-chrome.
Ohhh...... this explains everything.
Sorry for your trouble.
from simple-headless-chrome.
Related Issues (20)
- Cannot get onConsole working HOT 1
- setCookie documentation is wrong
- saveScreenshot clip param doesn't work HOT 4
- chrome-launcher not stating HOT 2
- [Question] Can I load a local html file and transform it into PDF ? HOT 1
- input selector HOT 1
- Example of getCookies and setCookie HOT 1
- Notification when a given script is loaded
- Timeout Error HOT 1
- Is there a way to use xpath to select an element
- Is there any way to set user agent? HOT 1
- Program unable to catch the error thrown by waitForPageToLoad()
- Download path
- Error: Invalid target undefined
- Outdated dependency: 1 high severity vulnerability in [email protected]
- Update the content in the PDF and/or add clickable link in the PDF runtime HOT 1
- A link containing hash "#", is not rendering correctly in printToPDF HOT 1
- How to switch between tabs?
- Can not connect with different port
- Do you support that lib?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-headless-chrome.