Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@applitools/dom-capture
Advanced tools
Library for scripts that run in the browser and extract information from web pages.
Library for scripts that run in the browser and extract information from web pages.
npm install @applitools/dom-capture
This package exports 2 types of functions:
Functions that can be used when working with puppeteer, CDP or Selenium in Node.js:
getProcessPageScript
getProcessPageAndSerializeScript
getCaptureDomScript
These async functions return a string with a function that can be sent to the browser for evaluation. It doesn't immediately invoke the function, so the sender should wrap it as an IIFE. For example:
const {getProcessPageScript} = require('@applitools/dom-capture');
const processPageScript = await getProcessPageScript();
const returnValue = await page.evaluate(`(${processPageScript})()`); // puppeteer
The non bundled version of the scripts:
processPage
processPageAndSerialize
These functions can then be bundled together with other client-side code so they are consumed regardless of a browser driver (this is how the Eyes.Cypress SDK uses it).
This package's dist
folder contains scripts that can be sent to the browser regradless of driver and language. An agent that wishes to extract information from a webpage can read the contents of dist/processPageAndSerialize
and send that to the browser as an async script. There's still the need to wrap it in a way that invokes it.
For example in Java
:
Object response = driver.executeAsyncScript("const callback = arguments[arguments.length - 1];(" + processPageAndSerialize + ")().then(callback, err => callback(err.message))";
FAQs
Unknown package
The npm package @applitools/dom-capture receives a total of 349,131 weekly downloads. As such, @applitools/dom-capture popularity was classified as popular.
We found that @applitools/dom-capture demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 57 open source maintainers 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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.