2016-08-23 13:15:37 +01:00
|
|
|
# scrapy
|
|
|
|
|
2016-08-23 13:17:29 +01:00
|
|
|
> Web-crawling framework.
|
2019-05-23 11:56:50 +01:00
|
|
|
> More information: <https://scrapy.org>.
|
2016-08-23 13:15:37 +01:00
|
|
|
|
|
|
|
- Create a project:
|
|
|
|
|
|
|
|
`scrapy startproject {{project_name}}`
|
|
|
|
|
|
|
|
- Create a spider (in project directory):
|
|
|
|
|
|
|
|
`scrapy genspider {{spider_name}} {{website_domain}}`
|
|
|
|
|
|
|
|
- Edit spider (in project directory):
|
|
|
|
|
|
|
|
`scrapy edit {{spider_name}}`
|
|
|
|
|
|
|
|
- Run spider (in project directory):
|
|
|
|
|
|
|
|
`scrapy crawl {{spider_name}}`
|
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Fetch a webpage as Scrapy sees it and print the source to stdout:
|
2016-08-23 13:15:37 +01:00
|
|
|
|
|
|
|
`scrapy fetch {{url}}`
|
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Open a webpage in the default browser as Scrapy sees it (disable JavaScript for extra fidelity):
|
2016-08-23 13:15:37 +01:00
|
|
|
|
|
|
|
`scrapy view {{url}}`
|
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Open Scrapy shell for URL, which allows interaction with the page source in a Python shell (or IPython if available):
|
2016-08-23 13:15:37 +01:00
|
|
|
|
|
|
|
`scrapy shell {{url}}`
|