Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const puppeteer = require('puppeteer');
- const GDlogin = require('./GD_login.js');
- const settings = require('./config_example.js');
- // var settings = [
- // {
- // app:"<app/domain>",
- // domain: "<domain>",
- // gd_username: "<GDuser>",
- // gd_pass: '<GDpass>',
- // heroku_username: "<HKuser>",
- // heroku_pass: '<HKpass>'
- // },
- // ]
- // module.exports = settings;
- const browserSettings = {
- timeout: 0,
- devtools: true,
- // headless: false, // default is true
- slowMo: 50 // slow down by 250ms
- // configure with other versions of chrome
- // executablePath: '/path/to/Chrome'
- // pipe <boolean> Connects to the browser over a pipe instead of a WebSocket. Defaults to false.
- };
- (async (browserSettings) => {
- // "puppeteer" module provides a method to launch a Chromium instance.
- const browser = await puppeteer.launch(browserSettings);
- let pages = await browser.pages();
- //////////////////////////////////////////////
- /// First Page
- //////////////////////////////////////////////
- HKlogin( settings[0].gd_username , ${settings[0].gd_pass} );
- // or even:
- // .then(
- // // do something after login
- // );
- //////////////////////////////////////////////
- /// Second Page
- //////////////////////////////////////////////
- GDlogin( settings[0].gd_username , ${settings[0].gd_pass} );
- await browser.close();
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement