this post was submitted on 11 Apr 2024
30 points (100.0% liked)

technology

23286 readers
137 users here now

On the road to fully automated luxury gay space communism.

Spreading Linux propaganda since 2020

Rules:

founded 4 years ago
MODERATORS
 

For a long time I hated markdown.

Now I love it.

What do you think?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] glans@hexbear.net 1 points 7 months ago (1 children)

OK sorry if I am telling you something you already know, but the classic tool to use to scrape a website is wget. Starting from one URL it can find all linked URLs and download them, or not, based on configuration. I have always found it pretty much accessible it was one of the earliest cli tools I used. You can learn a little bit or a lot. I think for this task you could learn a little. So that would get you a perfect local mirror or the site.

GNU has the comprehensive docs of course https://www.gnu.org/software/wget/. But starting with some random tutorial might be better choice.

To get it to markdown you'll have to add another step, perhaps turndown or pandoc.

Other projects to check out is httrack and tangentially archivebox.

[โ€“] RedWizard@hexbear.net 1 points 7 months ago

Its all good. I've heard of wget and used it in the past. I use PowerShell at work so I'm more accustomed to using it and it's an object oriented programing language which I have a good understanding of.

The module is masked on angular and so I could do element queries for the dom nodes I wanted and created some logic to move to the next paragraph under a given header until I reached the next header. Each header + paragraphs were collected then written to the HDD as markdown files.

But thanks for the tool suggestion, its good to know of alternatives.