Page Printer
Try for free
No credit card required
Go to Store
Page Printer
marco.gullo/page-printer
Try for free
No credit card required
Performs screenshots or print web pages in PDF format.
Tips and tricks
Pre-function
You can execute arbitrary code before performing a screenshot, passing a function which takes as input the Playwright Crawling Context.
You can also register information which will be written to the output Dataset, writing into the record with the key notes
in the userData
.
Example:
1const preFunction = async (context) => { 2 const { request, page } = context; 3 const { userData } = request; 4 const { notes } = userData; 5 6 // Perform some operation in the page 7 await page.selector('...').click(); 8 9 if (page.selector('...').isVisible) { 10 notes.isElementVisible = true; 11 } else { 12 notes.isElementVisible = false; 13 } 14}
Output data:
1[ 2 { 3 "url": "https://...", 4 "fileUrl": "...", 5 "fileKey": "...", 6 "notes": { 7 "isElementVisible": true 8 } 9 }, 10 { 11 "url": "https://...", 12 "fileUrl": "...", 13 "fileKey": "...", 14 "notes": { 15 "isElementVisible": false 16 } 17 } 18]
Developer
Maintained by Community
Actor Metrics
6 monthly users
-
2 stars
>99% runs succeeded
Created in Jul 2024
Modified 4 months ago
Categories