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

how to use in puppeteer script #478

Open
paragbaxi opened this issue Nov 27, 2019 · 0 comments
Open

how to use in puppeteer script #478

paragbaxi opened this issue Nov 27, 2019 · 0 comments

Comments

@paragbaxi
Copy link

I want to continue the session that this creates to grab my privacy settings. How can I do that? I've tried the following:

const FacebookLogin = require('facebook-login-for-robots')

const facebookLogin = new FacebookLogin({
  facebook: {
    email: process.env.FACEBOOK_USER, 
    password: process.env.FACEBOOK_PWD
  },
  puppeteer: {
    headless: false // helpful for troubleshooting
  }
})
await facebookLogin.goto("https://www.facebook.com/settings?tab=privacy&view", {
    waitUntil: 'networkidle2'
});

I get the following error:

facebook.js:20
await facebookLogin.goto("https://www.facebook.com/settings?tab=privacy&view", {
^^^^^

SyntaxError: await is only valid in async function
    at Module._compile (internal/modules/cjs/loader.js:892:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
    at internal/main/run_main_module.js:17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant