
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
selenium-node-webdriver
Advanced tools
Drive PhantomJS 1.8+ from Node.js using Selenium's WebDriver
This module provides a simple wrapper around the Node.js WebDriver implementation that ships with Selenium.
npm install selenium-node-webdriver
phantomjs --webdriver=4444 &
node node_modules/selenium-node-webdriver/examples/hello.js
This example (examples/hello.js) queries Google for 'webdriver' and returns
the titles of the results.
var WebDriver = require('selenium-node-webdriver');
WebDriver().
then(function (driver) {
driver.get('http://www.google.com').
then(function () {
return driver.
findElement(driver.webdriver.By.name('q')).
sendKeys('webdriver');
}).
then(function () {
return driver.
findElement(driver.webdriver.By.name('btnG')).click();
}).
then(function () {
return driver.executeScript(function () {
return Array.prototype.slice.
call(document.querySelectorAll('h3.r')).
map(function (result) {
return result.textContent;
});
});
}).
then(function (results) {
results.forEach(function (result) {
console.log(result);
});
driver.quit();
});
});
require('selenium-node-webdriver')(config <object>) -> PromiseThe module exports a factory function which accepts a config object and returns a promise. The config object has two properties, both of which are optional:
server: describes the WebDriver server to connect to; it has the following
properties:
host: the server's hostname (localhost)port: the port to connect to (4444)retries: the number of times to try to connect to the server (5)delay: the delay in ms between connection attempts (500)capabilities: describes the
capabilities
of the WebDriver client you are creating. It has the following properties by
default:
browserName: 'chrome'version: ''platform: 'ANY'javascriptEnabled: trueThe returned promise is resolved with a RemoteWebDriver instance if the connection succeeds or rejected with the error from the final retry if connection fails.
WebDriverJS: an introduction to using JavaScript as a WebDriver client
FAQs
Node.js WebDriver client from the Selenium project
We found that selenium-node-webdriver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.