Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Pageres | 9,487 | 241 | 59 | a year ago | 51 | October 27, 2022 | 19 | mit | TypeScript | |
Capture website screenshots | ||||||||||
Browsershot | 4,440 | 98 | 27 | 2 days ago | 132 | July 27, 2023 | 3 | mit | PHP | |
Convert HTML to an image, PDF or string | ||||||||||
Wayback | 1,440 | 2 days ago | 82 | March 21, 2023 | 60 | gpl-3.0 | Go | |||
An archiving tool with an IM-style interface that prioritizes privacy and accessibility, integrated with various archival services including Internet Archive, archive.today, IPFS, Telegraph, and file systems. | ||||||||||
1click Webpage Screenshot | 449 | 5 months ago | 66 | isc | JavaScript | |||||
Entire page Screenshot extension for Google Chrome. I'm developing open source extension for Google Chrome. All extension are free for use. Let's make Chrome great again! | ||||||||||
Witnessme | 445 | 2 years ago | 2 | July 26, 2020 | 11 | gpl-3.0 | Python | |||
Web Inventory tool, takes screenshots of webpages using Pyppeteer (headless Chrome/Chromium) and provides some extra bells & whistles to make life easier. | ||||||||||
Screenshot Stream | 226 | 80 | 11 | 4 years ago | 31 | June 11, 2017 | 9 | mit | JavaScript | |
Capture screenshot of a website and return it as a stream | ||||||||||
Pywebshot | 182 | 2 years ago | 3 | Python | ||||||
Command line webpage screenshot and thubnail generator | ||||||||||
Screencap | 173 | 34 | 2 | 4 years ago | 6 | July 19, 2015 | 21 | mit | JavaScript | |
A gem to screencap webpages in ruby. Uses Phantom.js under the hood. | ||||||||||
Nodejs Serverless Microservices Demo | 72 | 5 years ago | 1 | apache-2.0 | JavaScript | |||||
A set of Node.js microservices to track visual changes of web pages. | ||||||||||
Phpheadlesschrome | 67 | 1 | a year ago | 9 | March 29, 2022 | mit | PHP | |||
A PHP wrapper for using Google Chrome Headless mode. Convert URL or HTML to a PDF / screenshot. Easy to use and OOP interfaced. |
The package can convert a webpage to an image or pdf. The conversion is done behind the scenes by Puppeteer which controls a headless version of Google Chrome.
Here's a quick example:
use Spatie\Browsershot\Browsershot;
// an image will be saved
Browsershot::url('https://example.com')->save($pathToImage);
It will save a pdf if the path passed to the save
method has a pdf
extension.
// a pdf will be saved
Browsershot::url('https://example.com')->save('example.pdf');
You can also use an arbitrary html input, simply replace the url
method with html
:
Browsershot::html('<h1>Hello world!!</h1>')->save('example.pdf');
If your HTML input is already in a file locally use the :
Browsershot::htmlFromFilePath('/local/path/to/file.html')->save('example.pdf');
Browsershot also can get the body of an html page after JavaScript has been executed:
Browsershot::url('https://example.com')->bodyHtml(); // returns the html of the body
If you wish to retrieve an array list with all of the requests that the page triggered you can do so:
$requests = Browsershot::url('https://example.com')
->triggeredRequests();
foreach ($requests as $request) {
$url = $request['url']; //https://example.com/
}
To use Chrome's new headless mode pass the newHeadless
method:
Browsershot::url('https://example.com')->newHeadless()->save($pathToImage);
Learn how to create a package like this one, by watching our premium video course:
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
All documentation is available on our documentation site.
Please see CONTRIBUTING for details.
If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.
If you're not able to install Node and Puppeteer, take a look at v2 of browsershot, which uses Chrome headless CLI to take a screenshot. v2
is not maintained anymore, but should work pretty well.
If using headless Chrome does not work for you take a look at at v1
of this package which uses the abandoned PhantomJS
binary.
And a special thanks to Caneco for the logo
The MIT License (MIT). Please see License File for more information.