News for hackers. Stuff that matters.
Re:Show HN: Crawl a modern website to a zip, serve the websi... by meiraleal on Monday June 10, 2024 @04:30PM (#40638598)
Seems like a very useful tool to impersonate websites. Useful to scammers. Why would someone crawl their own website?
Re:Show HN: Crawl a modern website to a zip, serve the websi... by kej on Monday June 10, 2024 @04:40PM (#40638744)
Scammers don't need this to copy an existing website, and I could see plenty of legitimate uses. Maybe you're redoing the website but want to keep the previous site around somewhere, or you want an easy way to archive a site for future reference. Maybe you're tired of paying for some hosted CMS but you want to keep the content.
Re:Show HN: Crawl a modern website to a zip, serve the websi... by meiraleal on Monday June 10, 2024 @05:30PM (#40639371)
All the scenarios you described can be achieved by having access to the source code, assuming you own it.
Re:Show HN: Crawl a modern website to a zip, serve the websi... by kej on Monday June 10, 2024 @05:41PM (#40639498)
Lots of things are possible with access to source code that are still easier when someone writes a tool for that scenario.
Re:Show HN: Crawl a modern website to a zip, serve the websi... by meiraleal on Monday June 10, 2024 @05:52PM (#40639603)
Crawling a build you already have isn't one of them
Re:Show HN: Crawl a modern website to a zip, serve the websi... by p4bl0 on Monday June 10, 2024 @06:21PM (#40639886)
The website in question may be a dynamic website (e.g., WordPress, MediaWiki, or whatever other CMS or custom web app) and you either want a snapshot of it for backup, or you run it locally and want un static copy to host it elsewhere that only support static files.
Re:Show HN: Crawl a modern website to a zip, serve the websi... by unlog on Monday June 10, 2024 @06:19PM (#40639866)
> Why would someone crawl their own website?

My main use case is that the docs site https://pota.quack.uy/ , Google cannot index it properly. On here https://www.google.com/search?q=site%3Apota.quack.uy you will see some tiles/descriptions won't match what the content of the page is about. As the full site is rendered client side, via JavaScript, I can just crawl myself and save the html output to actual files. Then, I can serve that content with nginx or any other web server without having to do the expensive thing of SSR via nodejs. Not to mention, that being able to do SSR with modern JavaScript frameworks is not trivial, and requires engineering time.

Re:Show HN: Crawl a modern website to a zip, serve the websi... by ibeckermayer on Monday June 10, 2024 @09:10PM (#40641176)
I’m not quite understanding: you’re saying you deploy your site one way, then crawl it, then redeploy it via the zipfile you created? And why is SSR relevant to the discussion?
Re:Show HN: Crawl a modern website to a zip, serve the websi... by unlog on Monday June 10, 2024 @09:47PM (#40641408)
Modern websites execute JavaScript that render DOM nodes that are displayed on the browser.

For example if you look at this site on the browser https://pota.quack.uy/ and do `curl https://pota.quack.uy/` do you see any of the text that is rendered in the browser as output of the curl command?

You don't, because curl doesn't execute JavaScript, and that text comes from JavaScript. One way to fix this problem, is by having a Node.js instance running that does SSR, so when your curl command connects to the server, a node instance executes JavaScript that is streamed/served to curl. (node is running a web server)

Another way, without having to execute JavaScript in the server is to crawl yourself, let's say in localhost, (you do not even need to deploy) then upload the result to a web server that could serve the files.

Re:Show HN: Crawl a modern website to a zip, serve the websi... by jbaber on Monday June 10, 2024 @08:29PM (#40640932)
I want to take down a full copy of a site hosted on Squarespace before moving off of it.

I have no access to source and can't even republish the site directly without violating Squarespace's copyright.

But having the old site frozen in amber will be great for the redesign.

Re:Show HN: Crawl a modern website to a zip, serve the websi... by tomByrer on Monday June 10, 2024 @11:18PM (#40641911)
I think you can also screenshot full length in Chrome-based browsers; do both desktop & mobile widths.

It would be a good backup for the backup, & you designer will thank you.