View Single Post
Old 05-27-2013, 01:43 PM   #1
hakan42
Zealot
hakan42 is on a distinguished road
 
hakan42's Avatar
 
Posts: 136
Karma: 60
Join Date: Jul 2009
Location: Munich, Germany
Device: Nook Classic rooted; Galaxy S IV with Aldiko, other older devices
How to detect HTTP conditions in jsbrowser/browser.py

I am building an OPDS client for Beam EBooks with calibre-0.9.31

While testing, I managed to create a broken URL, making the server return HTTP code 203 to me, which seems to be written to the log file only...

Is there a way for me to catch this condition? My code looks like (reduced to the bare minimum)

Code:
from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.web.jsbrowser.browser import Browser
...
self.browser = Browser(enable_developer_tools=True)
...
self.browser.visit(url)
soup = BeautifulSoup(self.browser.html)
...
... further processing here ...
...
hakan42 is offline   Reply With Quote