Live data from Hacker News

Show HN: An API that takes a URL and returns a file with browser screenshots

github.com

31–40 of 107 posts

Re: Show HN: An API that takes a URL and returns a file with browser screenshots

#31
post #26

If you’re worried about the security risks, edge cases, maintenance pain and scaling challenges of self hosting there are various solid hosted alternatives: - https://browserless.io - low level browser control - https://scrapingbee.com - scraping specialists - https://urlbox.com - screenshot specialists* They’re all profitable and have been around for years so you can depend on the businesses and the tech. * Disclosu…

https://www.scraperapi.com/ is good too. Been using them to scrape via their API on websites that have a lot of captchas or anti scraping tech like DataDome.

Re: Show HN: An API that takes a URL and returns a file with browser screenshots

#32
post #24
post #15

Earlier quoted context omitted.

Yeah the EU cookie banners are annoying, I'm hoping to do some automation to click out of them before taking the screenshots

There are browser extensions you could run like consent-o-matic to try to click and hide the cookies from your screenshots: https://chromewebstore.google.com/detail/consent-o-matic/mdj... Otherwise using a combination of well-known class names, ‘accept’ strings, and heuristics such as z-index, position: fixed/sticky etc can also narrow down the number of likely elements that could be modals/banners. You could also as…

yeah that's what we basically did here at https://VisualSitemaps.com, but it can also be quickly become over-the-top, and you may end up removing important content. That's why in the end we added a second option to just manually enter CSS classes.

Re: Show HN: An API that takes a URL and returns a file with browser screenshots

#33
post #4

For anyone who might not be aware, Chrome also has the ability to save screenshots from the command line using: chrome --headless --screenshot="path/to/save/screenshot.png" --disable-gpu --window-size=1280,720 " https://www.example.com "

Quick note: when trying to do full page screenshots, Chrome does a screenshot of the current view, then scrolls and does another screenshot. This can cause some interesting artifacts when rendering pages with scroll behaviors.

Firefox does a proper full page screenshot and even allows you to set a higher DPS value. I use this a lot when making video content.

Check out some of the args in FF using: `:screenshot --help`

Re: Show HN: An API that takes a URL and returns a file with browser screenshots

#34
post #4

For anyone who might not be aware, Chrome also has the ability to save screenshots from the command line using: chrome --headless --screenshot="path/to/save/screenshot.png" --disable-gpu --window-size=1280,720 " https://www.example.com "

Firefox equivalent:

    firefox -screenshot file.png https://example.com --window-size=1280,720
A bit annoyingly, it won't work if you have Firefox already open.

Re: Show HN: An API that takes a URL and returns a file with browser screenshots

#35
post #4

For anyone who might not be aware, Chrome also has the ability to save screenshots from the command line using: chrome --headless --screenshot="path/to/save/screenshot.png" --disable-gpu --window-size=1280,720 " https://www.example.com "

Firefox equivalent: firefox -screenshot file.png https://example.com --window-size=1280,720 A bit annoyingly, it won't work if you have Firefox already open.

LOL, you and I posted very similar replies at the same time.

Re: Show HN: An API that takes a URL and returns a file with browser screenshots

#36
post #26

If you’re worried about the security risks, edge cases, maintenance pain and scaling challenges of self hosting there are various solid hosted alternatives: - https://browserless.io - low level browser control - https://scrapingbee.com - scraping specialists - https://urlbox.com - screenshot specialists* They’re all profitable and have been around for years so you can depend on the businesses and the tech. * Disclosu…

Happy to suggest another web scraping API alternative I rely on: https://scrapingfish.com

Re: Show HN: An API that takes a URL and returns a file with browser screenshots

#37
post #13
post #4

For anyone who might not be aware, Chrome also has the ability to save screenshots from the command line using: chrome --headless --screenshot="path/to/save/screenshot.png" --disable-gpu --window-size=1280,720 " https://www.example.com "

What features won't work without GPU?

This flag isn't valid anymore in the new chrome headless. Disable GPU doesn't exist unless your on the old version (and then, it was meant as a workaround for Windows users only).

I've used this via selenium not too long ago

Re: Show HN: An API that takes a URL and returns a file with browser screenshots

#38
simonw/shot-scraper has a number of cli args, a GitHub actions repo template, and docs: https://shot-scraper.datasette.io/en/stable/

From https://news.ycombinator.com/item?id=30681242 :

> Awesome Visual Regression Testing > lists quite a few tools and online services: https://github.com/mojoaxel/awesome-regression-testing

> "visual-regression": https://github.com/topics/visual-regression

Re: Show HN: An API that takes a URL and returns a file with browser screenshots

#39

Earlier quoted context omitted.

The website [1] is very strange. What does U.S. stand for? If I were to stumble on this I'd assume it was a fishing / scam website trying to impersonate the government. Bad vibes all around. [1] - https://us.ai/

The similarities with WhiteHouse.gov’s design can’t be much help either, I imagine.

I thought the same, but I didn't double check so I did not mention it.

Re: Show HN: An API that takes a URL and returns a file with browser screenshots

#40
post #16

Earlier quoted context omitted.

The website [1] is very strange. What does U.S. stand for? If I were to stumble on this I'd assume it was a fishing / scam website trying to impersonate the government. Bad vibes all around. [1] - https://us.ai/

I'll try to improve the vibes :( I've been working at this startup for almost two years now and that page and branding etc has been changing a lot as you can imagine ...

But what is the branding?

United States AI?

Like the premise of the company name is bad. Real bad.

Post reply on HN