3. Examples 例子
The best way to learn is with examples, and Scrapy is no exception. For this reason, there is an example Scrapy project named quotesbot, that you can use to play and learn more about Scrapy. It contains two spiders for
Quotes to Scrape, one using CSS selectors and another one using XPath expressions.
最好的學習方式是通過例子, Scrapy 當然也不例外。因此呢,我們這兒會有個 Scrapy 項目作為講述例子,項目名稱叫做 quotesbot, 你可以用來演示和了解更多關於 Scrapy的東東。這個項目包含兩個爬蟲程度,目標網站是
Quotes to Scrape
其中一個使用的是 CSS 選擇器,一個使用的是 XPath 表達式。也對,畢竟區別也就只有這個了。
The quotesbot project is available at:
scrapy/quotesbot. You can find more information about it in the project』s README.
quotesbot 項目託管到 github 上面啦,README 了解一下?
If you』re familiar with git, you can checkout the code. Otherwise you can download the project as a zip file by clicking
here.
如果你熟悉 git 的話,check out 代碼,否則以 zip 格式下載下來也一樣的。點擊下載吧。
https://github.com/scrapy/quotesbot/archive/master.zip推薦閱讀:
※Scrapy FormRequests 源碼解讀
※Scrapy cookies淺析
※scrapy做爬蟲時,導入Module的時候總顯示no module named ×××.items?
※用scrapy爬取微博信息
※第十一章 Scrapy入門程序點評