2016-08-23 13:15:37 +01:00
|
|
|
# scrapy
|
|
|
|
|
2016-08-23 13:17:29 +01:00
|
|
|
> Web-crawling framework.
|
2019-05-15 09:17:17 +01:00
|
|
|
> Homepage: <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}}`
|
|
|
|
|
|
|
|
- Fetch a webpage as scrapy sees it and print source in stdout:
|
|
|
|
|
|
|
|
`scrapy fetch {{url}}`
|
|
|
|
|
|
|
|
- Open a webpage in the default browser as scrapy sees it (disable javascript for extra fidelity):
|
|
|
|
|
|
|
|
`scrapy view {{url}}`
|
|
|
|
|
|
|
|
- Open scrapy shell for url, which allows interaction with the page source in python shell (or ipython if available):
|
|
|
|
|
|
|
|
`scrapy shell {{url}}`
|