Scrapy CSRF cookies not accepted and results in a 302 Redirect
来源:互联网 发布:软件缺陷预测技术 编辑:程序博客网 时间:2024/06/07 07:16
http://stackoverflow.com/questions/19057746/scrapy-csrf-cookies-not-accepted-and-results-in-a-302-redirect
from scrapy.http import FormRequestfrom scrapy.spider import BaseSpiderclass LoginSpider(BaseSpider): name = 'pinterest' start_urls = ['https://www.pinterest.com/login/'] # you can set the user agent either in the settings or the spider user_agent = ('Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) ' 'AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 ' 'Mobile/9A334 Safari/7534.48.3') def parse(self, response): data = {'email': 'XXX@xxx', 'password': 'xxx'} # no need for dont_filter return FormRequest.from_response(response, formdata=data, callback=self.after_login) def after_login(self, response): print response.url
http://stackoverflow.com/questions/16945256/scrapy-and-cookie-handling
yield Request("http://www.sas.no", cookies={ 'foo': 'bar'}, callback=self.nextfunction)
0 0
- Scrapy CSRF cookies not accepted and results in a 302 Redirect
- Snapshotting a view that has not been rendered results in an empty snapshot.
- Export op results in error "EXP.EXE has encountered a problem and needs to
- ios8调用相机报警告: Snapshotting a view that has not been rendered results in an empty snapshot. Ensure you
- Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has be
- ios8调用相机报警告: Snapshotting a view that has not been rendered results in an empty snapshot. Ensure yo
- Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has be
- ios8调用相机报警告: Snapshotting a view that has not been rendered results in an empty snapshot?
- Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has be
- iOS开发打不开相册相机,并报Snapshotting a view that has not been rendered results in an empty snapshot.
- 5.【字符串】Reverse Words in a String--Accepted Java code
- Redirect and POST in ASP.NET
- gridResult——Displaying task results in a table
- ios下打开相机遇到的闪退问题 (Snapshotting a view that has not been rendered results in an empty snapshot.)
- ios下打开相机遇到的闪退问题 (Snapshotting a view that has not been rendered results in an empty snapshot.)
- ios9微信支付报警告: Snapshotting a view that has not been rendered results in an empty snapshot. Ensure yo
- 406 not accepted
- global-results in struts2
- Eclipse使用入门教程
- Extjs自动提示消失提示框
- 怎样查看Jsp编译后生成的Java文件
- MAC adb环境配置
- sql server查找中文和英文
- Scrapy CSRF cookies not accepted and results in a 302 Redirect
- [精华] Perl 中的正则表达式
- 堆和栈的区别
- C#——类,实例
- android R.java消失问题(图片资源问题容易被忽略)
- Myeclipse中启动Weblogic9异常解决 .
- java5新特性之可变长参数
- 宏定义的黑魔法 - 宏菜鸟起飞手册
- 纯vc sdk实现http post 方式上传数据到web服务器