View Single Post
Old 12-14-2021, 02:09 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,341
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That will be because the website is using some kind of bot detection. Someone with more time than I do will need to figure out what is needed to bypass the bot detection.

Code:
calibre-debug -c 'from calibre import browser; br = browser(); br.open("https://www.thehindu.com/todays-paper/")'     
Traceback (most recent call last):
  File "/usr/bin/calibre-debug", line 21, in <module>
    sys.exit(main())
  File "/home/kovid/work/calibre/src/calibre/debug.py", line 272, in main
    exec(opts.command)
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/mechanize/_mechanize.py", line 257, in open
    return self._mech_open(url_or_request, data, timeout=timeout)
  File "/usr/lib/python3.10/site-packages/mechanize/_mechanize.py", line 313, in _mech_open
    raise response
mechanize._response.get_seek_wrapper_class.<locals>.httperror_seek_wrapper: HTTP Error 403: Forbidden
kovidgoyal is online now   Reply With Quote