Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prantadas/web-driver
Automate Chrome browser tasks using the Chrome DevTools Protocol and Node.js. This project provides a set of functions to fetch the installed Chrome browser version, download the corresponding ChromeDriver binary, set up the driver, create a new Chrome DevTools session, and open a website in the active session.
https://github.com/prantadas/web-driver
browserautomation chromium w3c web-driver
Last synced: 10 days ago
JSON representation
Automate Chrome browser tasks using the Chrome DevTools Protocol and Node.js. This project provides a set of functions to fetch the installed Chrome browser version, download the corresponding ChromeDriver binary, set up the driver, create a new Chrome DevTools session, and open a website in the active session.
- Host: GitHub
- URL: https://github.com/prantadas/web-driver
- Owner: PrantaDas
- Created: 2023-04-11T15:20:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-25T17:40:09.000Z (12 months ago)
- Last Synced: 2023-11-26T17:42:42.557Z (12 months ago)
- Topics: browserautomation, chromium, w3c, web-driver
- Language: JavaScript
- Homepage:
- Size: 29 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chrome Automation Project
Automate Chrome browser tasks using the Chrome DevTools Protocol and Node.js. This project provides a set of functions to fetch the installed Chrome browser version, download the corresponding ChromeDriver binary, set up the driver, create a new Chrome DevTools session, and open a website in the active session.
## Table of Contents
- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Functions](#functions)
- [Examples](#examples)## Introduction
This project aims to simplify the process of automating Chrome browser tasks by providing a collection of functions built on top of the Chrome DevTools Protocol. It includes functionality to determine the installed Chrome browser version, download the appropriate ChromeDriver binary, and automate various browser actions.
## Prerequisites
Before using this project, ensure you have the following prerequisites installed:
- Node.js: [Download Node.js](https://nodejs.org/)
- Google Chrome browser## Installation
1. Clone the repository:
```bash
git clone https://github.com/PrantaDas/web-driver.git
```2. Change to the project directory:
```bash
cd web-driver
```3. Install dependencies:
```bash
npm install or yarn
```## Usage
Import the functions you need from the `main.js` module and use them in your project. Make sure to handle errors appropriately.
```javascript
const { getChromeVersion, downLoadDriver, saveZipFile, unzipFile, start, createSession, navigateToUrl, turnFullScreen, takeScreenShot, closeSession, getActiveElem } = require("./main");(async () => {
try {
const version = await getChromeVersion();
console.log(version);
await downLoadDriver();
// Additional functions can be called here
} catch (e) {
console.log(e);
}
})();