A stealth web scraper for crawling websites and extracting clean text content with page and word limits.
npm install apex-scraperscrape function accepts a single options object.
link (string)* – Target website URL (must start with https://)
maxPage (number)* – Maximum number of pages to crawl
maxWord (number)* – Maximum number of words to extract
screenshot (boolean)* – If true, captures a full-page screenshot (Base64)
extractImages (boolean)* – If true, extracts all images (img tags, background images, lazy-loaded images)
extractHtml (boolean)* – If true, extracts the raw HTML source of the page
waitDuration (number)* – Time to wait after page load before extraction (in milliseconds)
waitSelector (string)* – Waits until the specified CSS selector appears on the page
js
import { scrape } from 'apex-scraper';
const result = await scrape({
link: 'https://example.com',
maxPage: 5,
maxWord: 10000
});
console.log(result);
`
---
$3
If your project uses CommonJS (require), you can still use Apex Scraper via dynamic import:
`js
(async () => {
const { scrape } = await import('apex-scraper');
const result = await scrape({
link: 'https://example.com',
maxPage: 5,
maxWord: 10000
});
console.log(result);
})();
`
---
$3
`json
{
"duration": 17.691,
"pages": [
{
"url": "https://example.com",
"content": "Extracted page text...",
"wordCount": 336,
"screenshot": "",
"images": [
"https://example.com/image1.png",
"https://example.com/image2.jpg"
],
"html": "..."
}
]
}
`
This response includes:
* duration – Total scrape duration (seconds)
* pages – Array of scraped pages
* url – Page URL
* content – Extracted visible text
* wordCount – Word count for the page
screenshot (optional)* – Full-page screenshot (Base64)
images (optional)* – Extracted image URLs (img, background, lazy-load)
html` (optional)* – Raw HTML source of the page