Socket
Book a DemoInstallSign in
Socket

puppeteer-select

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puppeteer-select

advanced css selectors for puppeteer

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
569
-27.05%
Maintainers
1
Weekly downloads
 
Created
Source

Puppeteer-select

at this point its just proof of concept made for solving my own issue. Feel free to add any suggestions

Why

I got used to some useful css selectors which are not supported by puppeteer like:

:contains(text)

example from puppeteer docks modified to be using puppeteer-selector

const puppeteer = require('puppeteer');
const select = require ('puppeteer-select');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  
  await select(page).assertElementPresent('div.Tag:contains(Events) > button');
  const element = await select(page).getElement('div.Tag:contains(Events) > button');
  await element.click()

  await browser.close();
})();

this lib is using "sizzle" all available selectors is here https://github.com/jquery/sizzle/wiki#selectors

Keywords

puppeteer

FAQs

Package last updated on 08 Aug 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.