Commit Graph

136 Commits

Author SHA1 Message Date
Pablo Hoffman e741a807d2 Added new Feed exports extension with documentation and storage tests. Closes #197.
Also deprecated File export pipeline (to be removed in Scrapy 0.11).

Still need to add tests for FeedExport main extension code.
2010-08-17 14:27:48 -03:00
Pablo Hoffman b563e56363 fixed bug in url_is_from_spider() when no allowed_domains class attribute is present 2010-08-16 12:25:51 -03:00
Pablo Hoffman 3e3a66620b Added support for returning deferreds from (some) signal handlers. Closes #193 2010-08-14 21:10:37 -03:00
Pablo Hoffman 5755bdcddc Improve spider errors logging which were previously logged as confusing "Unhandled errors" - closes #196 2010-08-13 01:45:47 -03:00
Pablo Hoffman 2822db730f added new MiddlewareManager class that will be used as base class for pipeline and middlewares 2010-08-10 18:03:47 -03:00
Pablo Hoffman c359a34d7d moved scrapy.core.exceptions to scrapy.exceptions, keeping backwards compatibility
--HG--
rename : scrapy/core/exceptions.py => scrapy/exceptions.py
2010-08-10 17:36:48 -03:00
Pablo Hoffman 3d121898e2 add signal handler name when logging errors 2010-08-09 13:32:44 -03:00
Pablo Hoffman a08e62a25d silence irrelevant (and confusing) errors generated in tests by signals left active after engine tests run - we should really rewrite engine tests asap 2010-08-09 13:24:22 -03:00
Pablo Hoffman 8de0dc3647 Log full traceback of signal handler errors in send_catch_log() - closes #194. Also made engine use send_catch_log for spider_idle signal 2010-08-09 12:05:03 -03:00
Pablo Hoffman b2878fbbef scrapy.utils.url_is_from_spider() - Consider spider name as possible domain for matching in scrapy.utils.url_is_from_spider() 2010-08-02 12:16:36 -03:00
Pablo Hoffman 65c3de8e6a Rewritten walk_modules function to support eggs, and added tests 2010-07-30 17:05:55 -03:00
Ismael Carnales 6d06824488 utils: Add walk_packages utility function
--HG--
rename : scrapy/tests/test_utils_misc.py => scrapy/tests/test_utils_misc/__init__.py
2010-07-30 15:53:24 -03:00
Pablo Hoffman e112def754 removed old untested module: scrapy.utils.mysql 2010-07-29 12:11:07 -03:00
Pablo Hoffman b8aa74ee9e bugfix in request_httprepr() function 2010-07-15 12:04:55 -03:00
Martin Olveyra b258fc3305 Fixed bug with float values in meta refresh 2010-07-01 11:46:06 -03:00
Pablo Hoffman 22555df56a response_httprepr: fixed error with unknown response codes (closes #169) 2010-06-27 19:32:26 -03:00
Daniel Grana 9148321765 do not redirect when there is a commented meta refresh header. closes #170 2010-06-25 12:57:15 -03:00
Pablo Hoffman d8ac4857a5 a couple of fixes to make tests pass on win32 2010-06-14 09:11:35 -03:00
Pablo Hoffman 495f23dea2 utils.serialize: added support for encoding Deferreds, and to refer spiders by name using 'spider::name' 2010-06-11 18:16:09 -03:00
Pablo Hoffman 6a33d6c4d0 * Added Scrapy Web Service with documentation and tests.
* Marked Web Console as deprecated.
* Removed Web Console documentation to discourage its use.
2010-06-09 13:46:22 -03:00
Pablo Hoffman dff763c683 Removed Scrapy engine singleton from scrapy.core.engine.scrapyengine. Now
engine can only be accesed through Scrapy Manager 'engine' attribute - ie.
scrapy.core.manager.engine.
2010-05-26 10:29:32 -03:00
Pablo Hoffman cae22930c8 Added ExecutionQueue class for feeding spiders and requests to scrape. This
class can (and is meant to) be subclassed by projects that want to use a custom
mechanism for feeding spiders to crawl. For example, a queue that pulls spiders
to scrape from Amazon SQS (an example will be added soon).

Also introduced a rather big core refactoring of Scrapy manager and Scrapy
engine.
2010-05-26 10:29:32 -03:00
Pablo Hoffman 8c1feb7ae4 Ported S3ImagesStore to use boto threads. This simplifies the code and makes
the following things no longer needed:

1. custom spider for S3 requests (ex. _S3AmazonAWSSpider)
2. scrapy.contrib.aws.AWSMiddleware
3. scrapy.utils.aws
2010-05-26 10:29:32 -03:00
Ping Yin 8497301784 arg_to_iter: return [arg] if arg is a dict
Signed-off-by: Ping Yin <pkufranky@gmail.com>
2010-04-24 21:20:23 +08:00
Daniel Grana b2f58207a4 avoid different behaviour in urljoin between pytho2.5 and python2.6+. see http://bugs.python.org/issue1432 2010-05-14 20:09:07 +01:00
Ping Yin 0aaa74d2bd extract_regex: encoding arg defaults to 'utf-8'
Sometimes it is not neccessary to pass the encoding argument. For
example, when the text argument is unicode. So set a default encoding.

Signed-off-by: Ping Yin <pkufranky@gmail.com>
2010-04-22 23:43:34 +08:00
Ping Yin 5c60ef69ab remove_tags: add keep argument
Signed-off-by: Ping Yin <pkufranky@gmail.com>
2010-04-24 19:08:01 +08:00
Ping Yin 94e6acebab Fix remove_tags like functions can't remove empty tag such as <br/>
Signed-off-by: Ping Yin <pkufranky@gmail.com>
2010-04-24 18:18:43 +08:00
Daniel Grana d3ab3cf85c url_query_cleaner: cleanup and avoid rejoining key-sep-value to build the query again
--HG--
extra : rebase_source : 7c2648b6dd1c2253f1ec0f11d5e1f2ee25bd1273
2010-05-12 14:09:37 -03:00
Daniel Grana ac646a3b47 url_query_cleaner: do not append ? if query is empty 2010-04-30 16:19:59 -03:00
Daniel Grana 3d731ba641 url_query_cleaner: add exclude and non-unique parameters support, also remove untested exception catching code and add missing tests 2010-04-30 09:41:11 -03:00
Pablo Hoffman b94abf36a3 Added scrapy.utils.py26.json to use python2.6 json module when available, otherwise failback to simplejson module or scrapy.xlib.simplejson. This way we can always assume json and avoid conditional code. 2010-04-12 10:44:07 -03:00
Pablo Hoffman 025b34e122 bugfix for python < 2.6 2010-04-11 07:07:38 -03:00
Pablo Hoffman 650d1c4fbe moved copytree() function from utils.python to utils.py26 2010-04-11 03:47:48 -03:00
Pablo Hoffman be45acd457 added scrapy.service and scrapy.tac for running from twistd 2010-04-11 03:37:08 -03:00
Rolando Espinoza La fuente db5c3df679 SEP12 implementation
* Rename BaseSpider.domain_name to BaseSpider.name

    This patch implements the domain_name to name change in BaseSpider class and
    change all spider instantiations to use the new attribute.

  * Add allowed_domains to spider

    This patch implements the merging of spider.domain_name and
    spider.extra_domain_names in spider.allowed_domains for offsite checking
    purposes.

    Note that spider.domain_name is not touched by this patch, only not used.

  * Remove spider.domain_name references from scrapy.stats

    * Rename domain_stats to spider_stats in MemoryStatsCollector
    * Use ``spider`` instead of ``domain`` in SimpledbStatsCollector
    * Rename domain_stats_history table to spider_data_history and rename domain
    field to spider in MysqlStatsCollector

  * Refactor genspider command

    The new signature for genspider is: genspider [options] <domain_name>.

    Genspider uses domain_name for spider name and for the module name.

  * Remove spider.domain_name references

  * Update crawl command signature <spider|url>

  * docs: updated references to domain_name

  * examples/experimental: use spider.name

  * genspider: require <name> <domain>

  * spidermanager: renamed crawl_domain to crawl_spider_name

  * spiderctl: updated references of *domain* to spider

  * added backward compatiblity with legacy spider's attributes
    'domain_name' and 'extra_domain_names'
2010-04-01 18:27:22 -03:00
Rolando Espinoza La fuente 35a7059636 cleanup and refactor of parse & fetch commands
* removed scrapy.utils.fetch
 * each command schedule requests and start scrapy engine
 * fetch command instance BaseSpider if given url does not match any spider or match more than one
 * parse command schedule url if one spider matches
 * parse and fetch doesn't support multiple urls as parameter
 * force spider behavior --spider moved from BaseCommand to only commands: fetch, parse, crawl
2010-04-01 17:16:38 -03:00
Rolando Espinoza La fuente 8db67b17a3 scrapy manager refactor
* ExecutionManager
    * deprecated runonce(*args)
    * changed start() to start(keep_alive=Bool)
    * changed crawl(*args) to crawl(requests, spider=None)
        * if no spider given, tries to resolve spider
          for each request
    * added crawl_url(url, spider=None)
    * added crawl_request(request, spider=None)
    * added crawl_domain(domain)
    * added crawl_spider(spider)
 * updated commands: crawl, runspider, start
 * updated webconsole
 * updated crawler
 * updated tests.test_engine
 * updated utils.fetch
2010-04-01 17:16:38 -03:00
Daniel Grana 996a1b3574 fix handling of relative base urls in get_base_url util
--HG--
extra : rebase_source : eb552219e6bf40bc0d2e35968c367105233b6ecc
2010-03-25 15:50:34 -03:00
Pablo Hoffman 1330697c3d Some improvements to Response encoding support:
* added encoding aliases, configurable through a new ENCODING_ALIASES setting
* Response.encoding now returns the real encoding detected for the body
* simplified TextResponse API by removing body_encoding() and
  headers_encoding() methods
* Response.encoding now tries to infer the encoding from the body always (it
  was done before only on HtmlResponse and TextResponse)
* removed scrapy.utils.encoding.add_encoding_alias() function
* updated implementation of scrapy.utils.response function to reflect these API
  changes
* updated documentation to reflect API changes
2010-03-25 15:47:10 -03:00
Pablo Hoffman 45411926b5 Improved encoding support by explicitly passing encoding to all str_to_unicode() and unicode_to_str() calls 2010-03-24 12:14:07 -03:00
Pablo Hoffman 54ae2c36d0 better implementation of open_in_browser() tests 2010-03-12 10:19:50 -02:00
Pablo Hoffman 38a296aa2c Added tests to open_in_browser() function 2010-03-12 09:52:39 -02:00
Pablo Hoffman 2ab94d75e2 Automated merge with http://hg.scrapy.org/scrapy-0.8 2010-03-12 09:32:35 -02:00
Pablo Hoffman c5cd8b9d3d Fixed bug in open_in_browser() function with Python 2.5 (closes #145). 2010-03-12 09:31:05 -02:00
Rolando Espinoza La fuente 7ddd4441e3 utils.python: added equal_attributes() to compare two objects arbitrary attributes
Sign-Off: Rolando Espinoza La fuente
2010-02-19 17:57:48 -04:00
Pablo Hoffman 496db55518 added some encoding aliases not provided in Python by default - fixes #130 2010-01-17 05:19:51 -02:00
Pablo Hoffman 6084be3b2e added iter_all() function to scrapy.util.trackref module and improved memory leaks documentation. also added a new FAQ antry about memory issues 2009-11-28 16:21:59 -02:00
Pablo Hoffman 34fcf6ba5b Added informative message when trying to use trackref and it's not enabled 2009-11-26 18:37:45 -02:00
Pablo Hoffman a2854e3948 Added hack to speed up processing of IgnoreRequest errors (#125) 2009-11-25 22:28:59 -02:00