I just had an experience I thought I'd share to prevent others from the
I have a Windows 7 desktop and a MacBook. I've done most of the development
on the Win7 machine, but I'm traveling so switched to the MacBook. I've
done a lot to isolate the differences between the two, but when I switched
over to the MacBook I discovered that I'd get to a phase of processing
where most of my document just vanished. I attributed this to Mac/Win
differences and tried to figure it out that way but after sleeping on it
realized that I hadn't installed lxml on the MacBook so the system was
quietly falling back to a different parser, and the behavior between
parsers was so different that I was getting completely different results.
Fixed it by specifying "lxml" as the second BeautifulSoup constructor
argument, so now when my system tries to build without lxml it puts out an
appropriate error message.
The parser fallback behavior sounds like a good idea at first but since the
behavior is so different I highly recommend specifying whatever parser
you're using via the constructor, so if you move your program to a machine
that doesn't have it you get a hint about what's wring.
-- Bruce Eckel