eclipse+PyDev 中报错"scrapy.spiders.Spider" ,可用"# @UndefinedVariable"压制.

# -*- coding:utf-8 -*-
'''
Created on 2015年10月22日
(1.1) 例子来源: http://scrapy-chs.readthedocs.org/zh_CN/latest/intro/tutorial.html
'''
import scrapy # 去掉 s 在PyDev中不报错, 但是无法运行.如果加上 s 虽然报错,但是程序能正常运行.
# 可以在 PyDev 中使用 " # @UndefinedVariable "来压制错误提示.
class DmozSpider(scrapy.spiders.Spider): # @UndefinedVariable
name = "dmoz"
allowed_domains = ["dmoz.org"]
start_urls = [
"http://www.dmoz.org/Computers/Programming/Languages/Python/Books/",
"http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/"
] def parse(self, response):
filename = response.url.split("/")[-2]
with open(filename, 'wb') as f:
f.write(response.body)
eclipse+PyDev 中报错"scrapy.spiders.Spider" ,可用"# @UndefinedVariable"压制.的更多相关文章
- Lifecycle mapping "org.eclipse.m2e.jdt.JarLifecycleMapping" Eclipse Maven报错
eclipse 项目中报错Lifecycle mapping "org.eclipse.m2e.jdt.JarLifecycleMapping" is not available, ...
- Eclipse + Pydev开发Python时import报错解决方法
一. 原文链接:http://blog.csdn.net/lhanchao/article/details/51306626 用eclipse +PyDev开发python时, ...
- eclipse+PyDev里面import win32api报错的问题解决
windows下面eclipse+PyDev的开发环境,安装了pywin32,写import win32api时老提示错误,在idle里正常执行. 原来是安装python库时,python安装路径下面 ...
- Eclipse+Pydev+numpy+scipy+matplotlib
之前一直在linux环境下使用python,作为一枚小菜还是更喜欢windows.我使用python主要是进行科学计算,安装软件.搭建环境遇到了非常多的问题,特此总结. 一.python安装 版本:2 ...
- 搭建Eclipse+pydev+python2.7.5+django1.5.1+mysql5.0.45平台
mysqldb 下载地址 http://sourceforge.net/projects/mysql-python/ or https://pypi.python.org/pypi/MySQL-pyt ...
- 在windows下用eclipse + pydev插件来配置python的开发环境
在windows下用eclipse + pydev插件来配置python的开发环境 一.安装 python 可以到网上下个Windows版的python,官网为:https://www.python. ...
- ubuntu14.04下手动安装JDK + eclipse + Pydev
说明:本文在root用户下进行,如不是root用户命令前加sodu 一.手动安装JDK 1.下载JDK 从官网http://www.oracle.com/technetwork/java/javase ...
- Scrapy框架-Spider和CrawlSpider的区别
目录 1.目标 2.方法1:通过Spider爬取 3. 通过CrawlSpider爬取 1.目标 http://wz.sun0769.com/index.php/question/questionTy ...
- Eclipse+Pydev 搭建开发环境(转)
add by zhj: 对原文略有修改 原文:http://www.cnblogs.com/TankXiao/archive/2013/05/29/3033640.html C#之所以容易让人感兴趣, ...
随机推荐
- E297: Write error in swap file解决方法
vi打开配置文件后显示E297: Write error in swap file,检查磁盘发现磁盘满了.使用du –max-depth=1 | sort –n –r 查找大文件所在位置并删除.
- iOS 第三方库冲突的处理
最近项目组在做一些第三方功能的集成,不止一次的遇到第三方库冲突的问题,报错如下: duplicate symbol _OBJC_METACLASS_$_JKSerializer in: /Users/ ...
- Java和.NET的GZIP压缩功能对比
本文主要比较了Java和.NET提供的GZIP压缩功能. 介绍 在本文中,我们将讨论Java和.NET提供的GZIP压缩功能,并且用实例来说明哪个压缩方法更佳. 在Java中,我们有提供GZIP压缩的 ...
- 【原】用PHP搭建基于swoole扩展的socket服务(附PHP扩展的安装步骤及Linux/shell在线手册)
最近公司的一项目中,需要用PHP搭建一个socket服务. 本来PHP是不适合做服务的,因为和第三方合作,需要采用高效而稳定的TCP协议进行数据通信.经过多次尝试,最终选择了开源的PHP扩展:swoo ...
- Extending JavaScript Natives
Most built-in JavaScript types are constructors whose prototypes contain the methods and other prope ...
- [C#]生成预定义全颜色表
生成Color类所有static预定义成员的颜色表 const long CELLS_PER_LINE = 10; const float MARGIN = 12; const float CELL_ ...
- Python队列服务 Python RQ Functions from the __main__ module cannot be processed by workers.
在使用Python队列服务 Python RQ 时候的报错: Functions from the __main__ module cannot be processed by workers. 原因 ...
- Redis集群方案应该怎么做
方案1:Redis官方集群方案 Redis Cluster Redis Cluster是一种服务器sharding分片技术.Redis Cluster集群如何搭建请参考我的另一篇博文:http://w ...
- progressBar 自定义
自定义 ProgressBar 进度条 自定义样式[复制链接] 黑牛 黑牛当前离线 威望 33 在线时间 31 小时 金钱 443 贡献 10 诚信度 0 最后登录 2013-10-17 ...
- An existing PostgreSql installation has been found... 的解决
PostgreSql卸载之后,重新安装时跳出如下信息: Anexisting PostgreSql installation has been found atC:\ProgramFiles\Post ...