codecamp

例子

例子

学习的最好方法就是参考例子,Scrapy 也不例外。Scrapy 提供了一个叫做 dirbot 的样例项目供您把玩学习。其包含了在教程中介绍的 dmoz spider。

您可以通过 [https://github.com/scrapy/dirbot]( https://github.com/scrapy/dirbot ) 找到 dirbot。其包含了 README 文件,详细介绍了项目的内容。

如果您熟悉 git,您可以 checkout 代码。或者您可以点击 Downloads 来下载项目的 tarball 或者 zip 的压缩包。

Snipplr 上的 scrapy 标签是用来分享 spider,middeware,extension 或者 script 代码片段。欢迎(并鼓励)在那分享您的代码。

Scrapy 入门教程
命令行工具(Command line tools)
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }