2.0.26 • Published 4 days ago

gologin v2.0.26

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
4 days ago

class GoLogin - class for working with gologin.com API

Official Package

Getting Started

GoLogin supports Linux, MacOS and Windows platforms.

Installation

npm i gologin

for running example.js install puppeteer-core

npm i puppeteer-core

Usage

Where is token? API token is here. To have an access to the page below you need register GoLogin account.

Token API in Settings

Example

import puppeteer from 'puppeteer-core';

import GoLogin from '../src/gologin.js';

const { connect } = puppeteer;

(async () => {
  const GL = new GoLogin({
    token: 'yU0token',
    profile_id: 'yU0Pr0f1leiD',
  });

  const { status, wsUrl } = await GL.start().catch((e) => {
    console.trace(e);

    return { status: 'failure' };
  });

  if (status !== 'success') {
    console.log('Invalid status');

    return;
  }

  const browser = await connect({
    browserWSEndpoint: wsUrl.toString(),
    ignoreHTTPSErrors: true,
  });

  const page = await browser.newPage();
  await page.goto('https://myip.link/mini');
  console.log(await page.content());
  await browser.close();
  await GL.stop();
})();

Running example:

DEBUG=gologin* node example.js

Methods

constructor

  • options <Object> Options for profile
    • autoUpdateBrowser <boolean> do not ask whether download new browser version (default false)
    • token <string> your API token
    • profile_id <string> profile ID
    • executablePath <string> path to executable Orbita file. Orbita will be downloaded automatically if not specified.
    • remote_debugging_port <int> port for remote debugging
    • vncPort <integer> port of VNC server if you using it
    • tmpdir <string> path to temporary directore for saving profiles
    • extra_params arrayof <string> extra params for browser orbita (ex. extentions etc.)
    • uploadCookiesToServer <boolean> upload cookies to server after profile stopping (default false)
    • writeCookesFromServer <boolean> download cookies from server and write to profile cookies file (default true)
    • skipOrbitaHashChecking <boolean> skip hash checking for Orbita after downloading process (default false)
import GoLogin from '../src/gologin.js';
const GL = new GoLogin({
    token: 'yU0token',
    profile_id: 'yU0Pr0f1leiD',
});

start()

  • returns: <object> { status, wsUrl }

start browser with profile id, returning WebSocket url for puppeteer

stop()

stop browser with profile id

DEBUG

For debugging use DEBUG=* node example.js command

Selenium

To use GoLogin with Selenium see selenium/example.js

Full GoLogin API

Swagger: link here

Postman: link here

For local profiles

startLocal()

  • returns: string

start browser with profile id, return WebSocket url for puppeteer. Extracted profile folder should be in specified temp directory.

stopLocal()

stop current browser without removing archived profile

example-local-profile.js

import puppeteer from 'puppeteer-core';

import GoLogin from '../src/gologin.js';

const { connect } = puppeteer;

(async () => {
  const GL = new GoLogin({
    token: 'yU0token',
    profile_id: 'yU0Pr0f1leiD',
    executablePath: '/usr/bin/orbita-browser/chrome',
    tmpdir: '/my/tmp/dir',
  });

  const wsUrl = await GL.startLocal();
  const browser = await connect({
    browserWSEndpoint: wsUrl.toString(),
    ignoreHTTPSErrors: true,
  });

  const page = await browser.newPage();
  await page.goto('https://myip.link');
  console.log(await page.content());
  await browser.close();
  await GL.stopLocal({ posting: false });
})();

Python support

pyppeteer (recommend) and Selenium supported (see file gologin.py)

for Selenium may need download webdriver

2.0.26

4 days ago

2.0.24

2 months ago

2.0.23

4 months ago

2.0.22

5 months ago

2.0.20

6 months ago

2.0.21

5 months ago

2.0.19

8 months ago

2.0.18

9 months ago

2.0.15

9 months ago

2.0.16

9 months ago

2.0.13

10 months ago

2.0.14

9 months ago

2.0.11

11 months ago

2.0.12

10 months ago

2.0.17

9 months ago

2.0.9

1 year ago

2.0.10

12 months ago

2.0.7

1 year ago

2.0.8

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.6

1 year ago

2.0.1

1 year ago

1.0.58

1 year ago

1.0.57

2 years ago

1.0.55

2 years ago

1.0.53

2 years ago

1.0.52

2 years ago

1.0.56

2 years ago

1.0.49

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.39

2 years ago

1.0.40

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.38

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.23

2 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.11

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago