Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

follow_all fails with an empty list of URLs #4408

Closed
ivanprado opened this issue Mar 6, 2020 · 0 comments · Fixed by #4420
Closed

follow_all fails with an empty list of URLs #4408

ivanprado opened this issue Mar 6, 2020 · 0 comments · Fixed by #4420
Assignees
Labels
Milestone

Comments

@ivanprado
Copy link
Contributor

@ivanprado ivanprado commented Mar 6, 2020

Description

follow_all with an empty list of urls fails with ValueError('Please supply exactly one of the following arguments: urls, css, xpath')

What I would expect instead is just an empty generator of requests.

Steps to Reproduce

class Spider(scrapy.Spider):

    def parse(self, response):
        yield from response.follow_all([], self.parse)

Expected behavior:

No error is raised

Actual behavior:

ValueError('Please supply exactly one of the following arguments: urls, css, xpath') exception is raised.

Versions

2.0

Additional context

I think the solution is just a matter of changing this line: https://github.com/scrapy/scrapy/blob/master/scrapy/http/response/text.py#L191

ivanprado added a commit to scrapinghub/scrapy-poet that referenced this issue Mar 6, 2020
Note that it fails due to the reported issue scrapy/scrapy#4408
@wRAR wRAR added the bug label Mar 12, 2020
@wRAR wRAR added this to the 2.0.1 milestone Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants