Scrapy, a fast high-level web crawling & scraping framework for Python.
changed robots.txt forbidden log level to DEBUG. closes #268
Pablo Hoffman6f4be21d4c44
diff --git a/scrapy/contrib/downloadermiddleware/robotstxt.py b/scrapy/contrib/downloadermiddleware/robotstxt.pyindex fe47317f7..0e99ef31e 100644--- a/scrapy/contrib/downloadermiddleware/robotstxt.py+++ b/scrapy/contrib/downloadermiddleware/robotstxt.py@@ -1,5 +1,5 @@"""-This is a middleware to respect robots.txt policies. To active it you must+This is a middleware to respect robots.txt policies. To activate it you mustenable this middleware and enable the ROBOTSTXT_OBEY setting."""@@ -8,7 +8,7 @@ import robotparserfrom scrapy.xlib.pydispatch import dispatcher-from scrapy import signals+from scrapy import signals, logfrom scrapy.project import crawlerfrom scrapy.exceptions import NotConfigured, IgnoreRequestfrom scrapy.http import Request@@ -25,7 +25,6 @@ class RobotsTxtMiddleware(object):self._parsers = {}self._spider_netlocs = {}self._useragents = {}- self._pending = {}dispatcher.connect(self.spider_opened, signals.spider_opened)dispatcher.connect(self.spider_closed, signals.spider_closed)@@ -33,7 +32,8 @@ class RobotsTxtMiddleware(object):useragent = self._useragents[spider]rp = self.robot_parser(request, spider)if rp and not rp.can_fetch(useragent, request.url):- raise IgnoreRequest("URL forbidden by robots.txt: %s" % request.url)+ log.msg("Forbidden by robots.txt: %s" % request, log.DEBUG)+ raise IgnoreRequestdef robot_parser(self, request, spider):url = urlparse_cached(request)