Tip: After the article is written, the table of contents can be automatically generated. How to generate it can refer to the help document on the right
Table of contents
1. How to open the PowerShell window
2. Create scrapy project command
2. Switch to the project folder
1. How to open the PowerShell window
Let's take windows 11 as an example, open this computer, open the D drive, hold down the shift key and click the left mouse button, and select to display more options.
After opening, we can see "Open Powweshell window here", then we can click to open it.
We can also use this method in folders as well.
2. Create scrapy project command
1. Create a scrapy project
Code example:
The role of scrapy startproject is to create the project name
scrapy startproject Mybaidu
Where Mybaidu is the project name
2. Switch to the project folder
cd Mybaidu
cd Mybaidu can be copied in powershell.
3. Give the crawler a name
scrapy genspider baidu www.baidu.com
Create a new crawler in the current folder or in the crawler folder of the current project. If it is in a project, the baidu parameter will be used as the name of the crawler.
scrapy genspider can also be copied directly in powershell.
3. Created
After the scrapy project is created, you can use the compiler to open the project.
Summarize
The article describes how to use the PowerShell window to create a scrapy project. If there are any deficiencies, please leave a private message.