View Single Post
Old 09-21-2010, 02:11 PM   #2786
krunk
Member
krunk began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Feb 2010
Location: Los Angeles, CA
Device: Kindle 3
I'm getting the following error in a custom recipe:

Code:
1% Fetching feed Skeptic Blog...
Failed feed: Skeptic Blog
Traceback (most recent call last):
  File "site-packages/calibre/web/feeds/news.py", line 1274, in parse_feeds
  File "site-packages/mechanize/_mechanize.py", line 209, in open
  File "site-packages/mechanize/_mechanize.py", line 261, in _mech_open
httperror_seek_wrapper: HTTP Error 403: Bad Behavior
I overloaded the get_browser() method with my own.

Code:
def get_browser(self):
    br = BasicNewsRecipe.get_browser()
    br.open(my_url)
    return br
From this I was able to determine it was throwing the 403 Bad Behavior error on mechanize.Browser().open().

This doesn't occur with a vanilla mechanize browser. Right now I'm doing:

Code:
def get_browser(self):
    br = mechanize.Browser()
    br.open(my_url)
    return br
This throws no errors and seems to parse well. My question is what in the BasicNewsRecipe's browser could be causing the above error? Is there a more correct or better way of resolving the problem?
krunk is offline