爬蟲-建立Scrapy專案

Outsider987
Feb 27, 2021

甚麼是Scrapy?

好啦別擔心,一開始我也不知道

簡單說Scrapy 是一個負責處理整個爬蟲系統資料流與事件的Frame Work,他可以很快速地幫你建立起一個爬蟲專案,並且幫你處理好大多數爬蟲的涵式

好吧,講了那麼多,我們趕快開始來建立我們的專案吧

現在就來開啟我們第一個Scrapy專案:

scrapy startproject ScrapyProject

你應該會看到這樣的字句在你的cmd裡面

You can start your first spider with:
cd ScrapyProject
scrapy genspider example example.com

接下來輸入:

  • cd ScrapyProject
  • scrapy genspider example [example.com](<http://example.com/>)

過來你會看到這樣的專案內容:

在example.py裡的內容有三個基本的變數:

這樣你就已經建立了一個基本的爬蟲專案了,是不是很棒呢

下一篇文章我們來談談beautifulsoup吧

說了這麼多,看完文章你做了甚麼?

下面Like給我按起來,分享出去(ʘ言ʘ╬)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Outsider987
Outsider987

Written by Outsider987

Hi, this is Victor In my college I was majors medical chemistry ,but I found the programing is interesting stuff I never met ,so I start to learning computer s

No responses yet

Write a response