Close page in pyppeteer example, mention asyncio reactor

This commit is contained in:
Eugenio Lacuesta 2020-06-10 12:11:49 -03:00
parent 78aa1b2bfc
commit b6c5289fb9
No known key found for this signature in database
GPG Key ID: DA3EF2D0913E9810
1 changed files with 5 additions and 1 deletions

View File

@ -266,12 +266,16 @@ The following is a simple snippet to illustrate its usage within Scrapy::
page = await browser.newPage()
await page.goto("https:/example.org")
title = await page.title()
await page.close()
yield {"title": title}
For this example to work, Scrapy needs to be running on top of the
:ref:`asyncio reactor <install-asyncio>`.
Keep in mind that this is just a proof of concept, since it circumvents
most of the Scrapy components (middlewares, dupefilter, etc).
There are some 3rd party projects which provide better integration:
The following is a list of 3rd party projects which provide better integration:
* https://github.com/elacuesta/scrapy-pyppeteer
* https://github.com/lopuhin/scrapy-pyppeteer