Wrap the yield line in a function to prevent throwing error when the code snippet is executed
This commit is contained in:
Kevin Toms 2024-01-17 15:49:51 -05:00
parent 88285e75b6
commit 46f94ec9cb
1 changed files with 5 additions and 4 deletions

View File

@ -414,10 +414,11 @@ How can I make a blank request?
from scrapy import Request
yield Request(
url="data:,",
callback=self.your_call_back,
)
def make_blank_request(your_call_back):
yield Request(
url="data:,",
callback=your_call_back,
)
In this case, the URL is set to a data URI scheme. Data URLs allow you to include data
in-line in web pages as if they were external resources. The "data:" scheme with an empty