Creating a Scrapy Project

Scrapy comes with an efficient command-line tool, also called the ‘Scrapy tool’. Commands are used for different purposes and, accept a different set of arguments, and options. To write the Spider code, we begin by creating, a Scrapy project, by executing the following command, at the terminal:

scrapy startproject gfg_spiderfollowlink

Use ‘startproject’ command to create a Scrapy Project

This should create a ‘gfg_spiderfollowlink’ folder in your current directory. It contains a ‘scrapy.cfg’, which is a configuration file, of the project. The folder structure is as shown below –

The folder structure of ‘gfg_spiderfollowlink’ folder

The folder contains items.py,middlerwares.py and other settings files, along with the ‘spiders’ folder. 

The folder structure of ‘gfg_spiderfollowlink’ folder

Keep the contents of the configuration files as they are currently.

How To Follow Links With Python Scrapy ?

In this article, we will use Scrapy, for scraping data, presenting on linked webpages, and, collecting the same. We will scrape data from the website ‘https://quotes.toscrape.com/’.

Similar Reads

Creating a Scrapy Project

Scrapy comes with an efficient command-line tool, also called the ‘Scrapy tool’. Commands are used for different purposes and, accept a different set of arguments, and options. To write the Spider code, we begin by creating, a Scrapy project, by executing the following command, at the terminal:...

Extracting Data from one Webpage

The code for web scraping is written in the spider code file. To create the spider file, we will make use of the ‘genspider’ command. Please note, that this command is executed at the same level where scrapy.cfg file is present....

Following Links

...

Contact Us