A notch above a monkey

Beautiful Soup - part 2

It seems I praised Beautiful Soup too quickly. I was playing with it yesterday and discovered it mangles Javascript included in file. I can’t say it does this every time, but it’s fairly obvious if you have few kilobytes of code stuck in file. There you have it, another argument why Javascript and CSS should be stored in external files.

It’s not an option for me though, so I’ll have to work around it.

It’s still a great module, as long as you can work within its limitations, but it’s not panacea. At least not yet.

If I find time, I’ll try to fix the problem, since I really dislike idea of processing files using usual methods (regular expressions & co.).

Uhm, I don't like the colors

We’ve been working with a talented group of designers, whose work I admired for a long time, on a design for our new service. Initial concept was exactly what we were looking for and the only changes that needed to be made, were consequences of our bad choices earlier on. In fact, everything was great except one thing.

We didn’t like proposed color schemes.

Every time I work with a designer, I’m afraid I’ll have to say that. It’s probably the most common complaint they hear and I really hate to join this particular crowd. Sure, they’ve always been graceful (at least the good designers), but I’m certain they wouldn’t mind spiking a voodoo doll of me, given a chance.

That got me thinking, is there a specific, but very common complaint for every trade out there? I couldn’t recall one for programmers, but that doesn’t mean there isn’t one. I certainly would love to hear your experiences.

We've come to praise Beautiful Soup

So, I’ve been working on this project for some time now, where I’d take user supplied HTML templates and transformed them into new templates, that our system can actually use.

I needed to mangle and change them, but I also didn’t want to require from users things like well-formedness and other stuff that makes sense only to web developers (and sadly not even to all of them). Mainly, I want this stuff to be used by everyone, even those with retarded web editors and if it’s good enough to be displayed in their browsers, it ought to be good enough for me.

This decision was made a lot easier, when I discovered Beautiful Soup . It’s a python module that makes screen-scraping much easier, but what is even more cool, is that it makes changing documents, even those with bad markup, extremely easy.

If you are a python developer, who needs to extract information from or possibly change documents with bad markup, this is the module to use. It will save you time, keep you sane and make you rich. Well, two out of three ain’t bad either.

Update: Beautiful Soup has issues with Javascript code included in HTML.