Commit Graph

40 Commits

Author SHA1 Message Date
Eugenio Lacuesta e2d5d357a7
Fix pycodestyle E502 2020-04-01 14:24:30 -03:00
Andrey Rakhmatullin 69cd2e247e Move a bunch of "from twisted.internet import reactor" inside functions. 2019-12-13 18:07:55 +05:00
Andrey Rakhmatullin 97fb61cec8 Move an import to postpone another "import twisted.internet.reactor". 2019-12-04 21:53:07 +05:00
Frederik Elwert 127bf499f1
Add documentation to `scrapy shell` command.
The special syntax required for local files (`./file.html`) is not documented as part of the `scrapy shell --help` output. This patch adds that.
2018-11-16 22:15:03 +01:00
Paul Tremberth 778bed07bf Let framework handle only HTTP redirects by default for fetch and shell commands 2016-12-07 17:56:13 +01:00
Paul Tremberth 35b655d2f8 Handle redirects transparently by default in shell and fetch
Adds --no-status-aware command line option to have previous behaviour
2016-11-24 12:23:22 +01:00
Paul Tremberth cae268402d Move guess_scheme() to scrapy.utils.url 2016-01-28 13:42:04 +01:00
Paul Tremberth 7a51d370f3 Regex-based guess_scheme() + refactor tests 2016-01-22 17:16:27 +01:00
Paul Tremberth 60052b3c68 Remove unused re import 2016-01-22 13:18:08 +01:00
Paul Tremberth be239f339c Remove unused import 2016-01-22 13:13:46 +01:00
Paul Tremberth 6d73e057b5 Extract guess_scheme function and refactor tests 2016-01-22 13:07:42 +01:00
Paul Tremberth 1406cab19b Merge remote-tracking branch 'origin/master' into 1550-shell_file 2016-01-21 16:48:16 +01:00
Leonid Amirov 97b51ea33b issue GH #1550 - six library is used instead of urlparse for python3 compatibility 2015-11-03 14:57:37 +03:00
Leonid Amirov bc9db65358 issue GH #1550 - scrapy shell argument fixes: "example.com" requests "http://example.com"; "example" requests "file://example"; "./example.com" requests "file://example.com" 2015-11-02 16:08:19 +03:00
Leonid Amirov 98a2e77a75 issue GH #1550 - fixed error: shell command wasn't accepting files URIs 2015-11-02 15:30:49 +03:00
preetwinder 8c629eee3e adds docstring, tests and correction 2015-09-24 17:28:44 +00:00
preetwinder c517951a48 add_scheme_if_missing for scrapy shell command 2015-09-24 17:28:44 +00:00
Νικόλαος-Διγενής Καραγιάννης f4dd8bcdc2 Disable dupefilter in shell 2015-06-16 17:31:37 +03:00
Julia Medina 616aec92c8 Move scrapy/command.py to scrapy/commands/__init__.py 2015-05-09 03:20:36 -03:00
Julia Medina ac40ef611a Custom handler to count log level occurrences in a crawler 2015-04-22 17:24:40 -03:00
Julia Medina 7a958f90be Replace scrapy.log calls for their equivalents in the logging std module
Changes:
 - Each module takes 'scrapy' logger and logs through it
 - Lazy string evaluation in all log messages
 - Added missing log messages in scrapy/core/engine.py
 - Contextual data such as crawler or spider instances, and failures
2015-04-22 17:24:39 -03:00
Mikhail Korobov ad587ea792 rename CrawlerRunner.spiders to CrawlerRunner.spider_loader 2015-04-17 01:54:26 +05:00
Daniel Graña 8ddf0811a8 Correctly detect when all managed crawlers are done in CrawlerRunner 2014-09-09 17:21:39 -03:00
Julia Medina 51532af69a Erase unneeded flag in CrawlerProcess.start 2014-09-07 13:03:34 -03:00
Julia Medina 6339864f95 Minor refactor in the docs and functions used in the shell command 2014-08-14 12:32:37 -03:00
Julia Medina 9cbbfd8b04 Adjust spiders' utils to new SpiderManager API 2014-08-12 14:02:56 -03:00
Alex Cepoi 7bdeabc0ed fix log intermixing in scrapy shell command 2013-08-21 01:42:03 +02:00
Alex Cepoi a812def59e port all scrapy commands to new CrawlerProcess 2013-08-19 23:40:23 +02:00
Michal Danilak ea68250d77 Added --spider option to "shell" command. 2013-01-02 17:13:37 +01:00
Pablo Hoffman 8d77005047 scrapy shell: start shell in main thread and crawler in secondary thread, instead of the other way around. fixes #100 2012-05-22 19:15:54 -03:00
Pablo Hoffman 84f518fc5e More core changes:
* removed execution queue (replaced by newer spider queues)
* added real support for returning iterators in Spider.start_requests()
* removed support for passing urls to 'scrapy crawl' command
2011-07-15 15:18:39 -03:00
Pablo Hoffman 318f7f4c58 Added support for passing code to evaluate in Scrapy shell command (closes #249) and simplified handling of shell errors 2010-09-23 13:49:29 -03:00
Pablo Hoffman 7cfc379230 Execution Queue refactoring by taking out the queue backend to a new Spider
Queue API. Also ported SQS Execution Queue to Spider Queue API, and make the
scrapy queue command use the Spider Queue directly, with deferreds support.

Closes #220.
2010-09-03 14:29:27 -03:00
Pablo Hoffman f6c11af4c2 Moved module: scrapy.core.queue to scrapy.queue
--HG--
rename : scrapy/core/queue.py => scrapy/queue.py
2010-08-26 21:15:32 -03:00
Pablo Hoffman 8fc78c4d0a Refactoring of Crawler, Commands, Execution Queue and Spider Manager:
Commands changes:

* removed (somewhat hacky) --init argument from settings command
* added set_crawler method to Commands, and a ``crawler`` property that returns
  a configured crawler. This way, commands that don't require a crawler (such
  as startproject) won't need to configure one.

Execution Queue changes:

* changed SERVICE_QUEUE_FILE setting to SQLITE_DB
* removed SERVICE_QUEUE setting
* added QUEUE_CLASS setting for defining the class to use for the execution queue
* added SERVER_QUEUE_CLASS setting for defining the class to use for the
  execution queue in server mode (runserver command)

Spider Manager changes:

* simplified SpiderManager API by removing the load() method
* added from_settings classmethod to SpiderManager
* added spider_modules constructor argument to SpiderManager

Crawler changes:

* added install() method to Crawler (to install it in scrapy.project) and
  uninstall() to remove it
* use CrawlerProcess.install() in scrapy.cmdline
* use crawler.install() and crawler.uninstall() in tests that a crawler in
  scrapy.project
* make telnet console and webservice play nicer with twisted by stopping
  listening when then engine goes down
* refactored Scrapy engine tests - it no longer uses the crawler singleton.
  Closes #215.
2010-08-25 19:24:36 -03:00
Pablo Hoffman faf7a7da83 Moved scrapymanager singleton to scrapy.project module. Refs #189
Detail of changes:

* Moved scrapy.core.manager.ExecutionManager class to scrapy.crawler.Crawler
* Added scrapy.project.crawler singleton to reference a singleton instance of
  Crawler class (previously known as scrapymanager)
* Left an alias scrapy.core.manager.scrapymanager to scrapy.project.crawler for
  backwards compatibility (to be removed in Scrapy 0.11)
2010-08-22 02:10:53 -03:00
Pablo Hoffman 1d3b9e2ca8 Scrapy shell refactoring 2010-08-20 11:26:14 -03:00
Pablo Hoffman 6dd76ab54b Fixed bug in Scrapy shell which hanged if requests failed to download (#205), added dont_filter=True to requests generated when calling the shell with a url argument, and changed formatting of messages 2010-08-19 21:11:39 -03:00
Pablo Hoffman a71521bfba Default per-command settings are now specified in the default_settings attribute of the command object. Closes #201 2010-08-17 18:30:13 -03:00
Pablo Hoffman 56abafec61 moved scrapy.command.commands module to scrapy.commands
--HG--
rename : scrapy/command/commands/__init__.py => scrapy/commands/__init__.py
rename : scrapy/command/commands/crawl.py => scrapy/commands/crawl.py
rename : scrapy/command/commands/fetch.py => scrapy/commands/fetch.py
rename : scrapy/command/commands/genspider.py => scrapy/commands/genspider.py
rename : scrapy/command/commands/list.py => scrapy/commands/list.py
rename : scrapy/command/commands/parse.py => scrapy/commands/parse.py
rename : scrapy/command/commands/runspider.py => scrapy/commands/runspider.py
rename : scrapy/command/commands/settings.py => scrapy/commands/settings.py
rename : scrapy/command/commands/shell.py => scrapy/commands/shell.py
rename : scrapy/command/commands/start.py => scrapy/commands/start.py
rename : scrapy/command/commands/startproject.py => scrapy/commands/startproject.py
2010-05-26 10:29:32 -03:00