Are there any known issues with the Beautiful Soup that is bundled with Calibre? I'm finding that from within my plugin, a soup.find(class_="foo") is returning None, while in my test script hitting the same URL it works and finds the div I want. I logged the page contents and they look fine so everything seems to be working up to the point I call find (I can copy the metadata log to the clipboard and paste it in an editor and see the element that the find failed to locate).
EDIT: I notice that doing finds by id seems to work, but not finds by class.
EDIT: the above was the key. The soup distributed with Calibre is an older version that doesn't support the class_ parameter. Instead you must use:
find(attrs={'class':'foo'})
Last edited by geekraver; 01-26-2014 at 06:39 PM.
|