scrapy-splash icon indicating copy to clipboard operation
scrapy-splash copied to clipboard

Error 400

Open vladiscripts opened this issue 4 years ago • 1 comments

An example of documentation https://github.com/scrapy-plugins/scrapy-splash (section "Examples") has the code:

script = """
function main(splash)
  splash:init_cookies(splash.args.cookies)
  assert(splash:go{
    splash.args.url,
    headers=splash.args.headers,
    http_method=splash.args.http_method,
    body=splash.args.body,
    })
...
"""

Often it raise the Scrapy error Error 400 without description. Skipping of html pages, it's big problem. (I trying this example on a site, it every second re-launch of spider skip all site pages.) As I can understand, this error of some splash.args parameter in assert. How to logging it, how to print error parameter and error description in Scrapy log?

vladiscripts avatar Jan 28 '20 17:01 vladiscripts

Errors in lua scripts only become a logging WARNING (if SPLASH_LOG_400 is set). I would also like to handle these errors (in python) somehow; throwing a python exception or at least a logging.ERROR.

hakanw avatar Feb 27 '20 09:02 hakanw