1.0.5 • Published 8 months ago
@karpeleslab/klbfw-dynfetch v1.0.5
@karpeleslab/klbfw-dynfetch
A utility for fetching dynamically rendered HTML content from websites using Puppeteer.
Usage with npx
You can run this tool directly without installation using npx:
npx @karpeleslab/klbfw-dynfetch <url>Example:
npx @karpeleslab/klbfw-dynfetch https://example.comThis will output the fully rendered HTML after JavaScript execution.
Installation
Global Installation
npm install -g @karpeleslab/klbfw-dynfetchThen you can use it as:
klbfw-dynfetch <url>Local Installation
npm install @karpeleslab/klbfw-dynfetchProgrammatic Usage
You can also use this package programmatically in your code:
const { fetchRenderedHtml } = require('@karpeleslab/klbfw-dynfetch');
fetchRenderedHtml('https://example.com')
.then(html => {
console.log(html);
})
.catch(error => {
console.error('Error:', error);
});Development
Clone the repository and install dependencies:
git clone https://github.com/karpeleslab/klbfw-dynfetch.git
cd klbfw-dynfetch
npm installRun locally:
npm start <url>or
node src/index.js <url>