
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.
page-text-parser
Advanced tools
A function that returns an array of text content for a webpage given a jQuery-like selector and a URL.
A function that returns an array of text content for a webpage given a jQuery-like selector and a URL.
import { pageTextParser } from 'page-text-parser';
async function run() {
const texts = await pageTextParser('https://google.com','a');
// prints out text content of all anchor tags on google.com. If nothing was found or there was an error with website retrieval, texts will be an empty array.
texts.forEach(text => {
console.log(text);
})
}
run();
Extended usage with optional attribute value to also retrieve with the text
import { pageTextParser } from 'page-text-parser';
async function run() {
const texts = await pageTextParser('https://google.com','a', 'href');
// prints out an array of objects with text: and attributeValue: keys containing text content of all anchor tags and the href value of on google.com. If nothing was found or there was an error with website retrieval, texts will be an empty array.
texts.forEach(text => {
console.log(JSON.stringify(text));
})
}
run();
I am using Cheerio which is a Node implementation of JQuery, and their documentation states:
Like jQuery, it’s the primary method for selecting elements in the document, but unlike jQuery it’s built on top of the CSSSelect library, which implements most of the Sizzle selectors.
Read the Cheerio docs for more detailed information on how the selector syntax differs from actual jQuery.
FAQs
A function that returns an array of text content for a webpage given a jQuery-like selector and a URL.
We found that page-text-parser 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.