Skip to content

Deprecation Warning in an example from README.rst #229

@leovp

Description

@leovp

Steps to reproduce:

  1. Create a new virtualenv (to avoid conflicts and what not);
  2. Install the latest grab from pypi;
  3. Create main.py and copy-paste a "Grab::Spider Example" from README.rst;
  4. Run the script.

Result:

DEBUG:grab.spider.base:Using memory backend for task queue
DEBUG:grab.network:[01] GET https://www.google.com/search?q=python
DEBUG:grab.network:[02] GET https://www.google.com/search?q=ruby
/home/leovp/.pyenv/versions/habratest-3.5.2/lib/python3.5/site-packages/grab/deprecated.py:250: GrabDeprecationWarning: The Grab.response attribute is deprecated. Use Grab.doc instead.
warn('The Grab.response attribute is deprecated. '
DEBUG:grab.network:[03] GET https://www.google.com/search?q=perl
python: https://www.python.org/
ruby: https://ru.wikipedia.org/wiki/Ruby
DEBUG:grab.stat:RPS: 2.68 []
perl: https://ru.wikipedia.org/wiki/Perl
DEBUG:grab.stat:RPS: 0.00 []
DEBUG:grab.spider.parser_pipeline:Started shutdown of parser process: Thread-1
DEBUG:grab.spider.parser_pipeline:Finished joining parser process: Thread-1
DEBUG:grab.spider.base:Main process [pid=17426]: work done

The issue here is that Grab::Spider Example doesn't access grab.response attribute directly, so the warning is not justified in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions