
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
A web scraping tool built with TypeScript, utilizing Cheerio and Axios to fetch and filter HTML content from web pages.
A web scraping tool built with TypeScript, utilizing Cheerio and Axios to fetch and filter HTML content from web pages.
npm install scrapyyy
Fetch and parse HTML from web pages.
Include or exclude specific HTML tags during scraping.
Filter content based on CSS selectors.
Optionally return only the data (text content) or full HTML.
First, import the scraper module and use it to scrape web pages.
import { scraper } from "scrapyyy";
// Example usage
(async () => {
const result = await scraper("https://example.com", {
onlyData: true,
includeTags: ["div", "span"],
excludeTags: ["script", "style"],
selector: ["#content", ".main"],
});
console.log(result);
})();
scraper(url, options):
string
): The URL of the webpage to scrape.object
): Optional configuration to modify the scraping process.
boolean
): If true
, returns only the text content of the page (default: false
).string[]
): List of tag names to include in the result.string[]
): List of tag names to exclude from the result.string[]
): CSS selectors to filter the content (e.g., #id
, .class
, tagName
).const html = await scraper("https://example.com");
console.log(html); // Full HTML content of the page
const filtered = await scraper("https://example.com", {
includeTags: ["html", "body", "head", "title", "p", "div"],
excludeTags: ["script"],
});
console.log(filtered); // HTML content with only <p> and <div>, excluding <script>
Note : If you are including a certain tag but not its parent tag, it won't be present in the result.
eg. If you include p tag but not include body, no p tags will actually be included.
const selectedContent = await scraper("https://example.com", {
selector: [".header", "#main"],
});
console.log(selectedContent); // Text content from elements matching the provided selectors
const data = await scraper("https://example.com", { onlyData: true });
console.log(data); // Plain text content of the page
scrapyyy "https://example.com" '{"onlyData": true,"includeTags":["html","body"], "excludeTags": ["script", "style"] , "selector": [".header", "#main"]}'
MIT
FAQs
A web scraping tool built with TypeScript, utilizing Cheerio and Axios to fetch and filter HTML content from web pages.
We found that scrapyyy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.