You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cookies.py中的cookies数组里面放的是string数据类型,在debug的时候发现下载器中间件调用了一个这个方法:
def _format_cookie(self, cookie):
cookie_str = '%s=%s' % (cookie['name'], cookie['value'])
因为我们传的cookie是string类型,所以我这里debug的时候报了一个这样的错误:TypeError: string indices must be integers, not str。(String类型的索引必须是整数)
最后自己改了一下spider1源码:将原来登录成功后的cookie以dict类型放入cookies数组里就没问题了。
The text was updated successfully, but these errors were encountered:
cookies.py中的cookies数组里面放的是string数据类型,在debug的时候发现下载器中间件调用了一个这个方法:
def _format_cookie(self, cookie):
cookie_str = '%s=%s' % (cookie['name'], cookie['value'])
因为我们传的cookie是string类型,所以我这里debug的时候报了一个这样的错误:TypeError: string indices must be integers, not str。(String类型的索引必须是整数)
最后自己改了一下spider1源码:将原来登录成功后的cookie以dict类型放入cookies数组里就没问题了。
The text was updated successfully, but these errors were encountered: