部署爬虫到scrapy cloud上出现'_sre.SRE_Match' object has no attribute '__getitem__'的错误
2018-03-18 11:02
886 查看
简单记录bug
主要原因是我写的xxSpider.py里面用到了正则表达式re.match()的返回对象在py3.6当中的[]索引新特性,详见官方文档而scrapy cloud服务器用的是py2.7,这点大家要注意,所以了解了原因,问题就迎刃而解了。我的爬虫只需要获取正则匹配的内容,所以将link[0]替换为link.group(0)即可。
相关文章推荐
- python 编译错误TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
- 使用Buildozer部署时,出现AttributeError: 'NoneType' object has no attribute 'group'错误的解决
- web.py 启动时候出现AttributeError: 'module' object has no attribute 'inet_pton'错误
- Ubuntu运行scrapy报“scrapy: 'module' object has no attribute 'OP_SINGLE_ECDH_USE'错误解决方法”
- python:TypeError: 'coo_matrix' object has no attribute '__getitem__'
- Spark Reduce TypeError: 'int' object has no attribute '__getitem__
- 【转载】C#调用python文件时出现'module' object has no attribute '_getframe'
- python :TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
- 'WebDriver' object has no attribute 'get_screenshots_as_file' 错误
- scrapy出现:AttributeError: 'list' object has no attribute 'xpath'
- Ubuntu16.04上启动Spyder出现错误AttributeError: 'module' object has no attribute '_base'
- TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'(已解决)
- 'generator' object has no attribute '__getitem__'
- python object has no attribute '__getitem__'
- TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
- TypeError: 'generator' object has no attribute '__getitem__'
- scrapy:使用response.follow()方法时出现AttributeError: 'HtmlResponse' object has no attribute 'follow'
- Python 程序中遇到 'float' object has no attribute '__getitem__'
- 出现错误如下:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
- 'NoneType' object has no attribute '__getitem__'和argument of type 'NoneType' is not iterable 异常的解决办法