So I'm trying to go in and clean up some of my ebooks because I have some in my digital library that have various things that really annoy me, page headers and such with my name and email, page numbers stuck in the middle of paragraphs, things like that

I've got calibre downloaded and can get into the actual HTML of the ebooks and make edits but my GOD it's slow and tedious to do it manually

There HAS to be a way to automate this somehow, right? Some kind of script where I can say "Find every instance of this string and delete it" right?

I'm sure I would have to download some sort of scripting language but like

That's fine

@coriander I've never used BeautifulSoup but reading the documentation this seems like a good way to do it with Python

Or you could download node and import the JSDOM package

I'd recommend the former because node sucks

Follow

@coriander download python: python.org/downloads/windows/

I would then run py -m pip install beautifulsoup4 in the command line/powershell/whatever

To write python code use your preferred IDE. If you don't have one then use Sublime Text.

I would watch a quick tutorial like youtube.com/watch?v=gRLHr664tX and then consult the official docs and stackexchange for more questions

@coriander when you write code make sure at least 60% of your time is spent writing code. it can be easy when you're new to watch tutorial after tutorial but that is like trying to learn piano by watching youtube videos. that's dumb because playing piano is something you do. programming is something you do

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.