首页 > 代码库 > python之scrapy入门教程

python之scrapy入门教程

看这篇文章的人,我假设你们都已经学会了python(派森),然后下面的知识都是python的扩展(框架)。

在这篇入门教程中,我们假定你已经安装了Scrapy。如果你还没有安装,那么请参考安装指南。

我们将使用开放目录项目(dmoz)作为抓取的例子。

这篇入门教程将引导你完成如下任务:

  1. 创建一个新的Scrapy项目
  2. 定义提取的Item
  3. 写一个Spider用来爬行站点,并提取Items
  4. 写一个Item Pipeline用来存储提取出的Items

Scrapy是由Python编写的。如果你是Python新手,你也许希望从了解Python开始,以期最好的使用Scrapy。如果你对其它编程语言熟悉,想快速的学习Python,这里推荐 Dive Into Python。如果你对编程是新手,且想从Python开始学习编程,请看下面的对非程序员的Python资源列表。

 

新建工程

在抓取之前,你需要新建一个Scrapy工程。进入一个你想用来保存代码的目录,然后执行:

Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.T:\>scrapy startproject tutorialT:\>

这个命令会在当前目录下创建一个新目录tutorial,它的结构如下:

T:\tutorial>tree /fFolder PATH listingVolume serial number is 0006EFCF C86A:7C52T:.│  scrapy.cfg│└─tutorial    │  items.py    │  pipelines.py    │  settings.py    │  __init__.py    │    └─spiders            __init__.py

这些文件主要是:

  • scrapy.cfg: 项目配置文件
  • tutorial/: 项目python模块, 呆会代码将从这里导入
  • tutorial/items.py: 项目items文件
  • tutorial/pipelines.py: 项目管道文件
  • tutorial/settings.py: 项目配置文件
  • tutorial/spiders: 放置spider的目录

 

定义Item

Items是将要装载抓取的数据的容器,它工作方式像python里面的字典,但它提供更多的保护,比如对未定义的字段填充以防止拼写错误。

它通过创建一个scrapy.item.Item类来声明,定义它的属性为scrpy.item.Field对象,就像是一个对象关系映射(ORM). 
我们通过将需要的item模型化,来控制从dmoz.org获得的站点数据,比如我们要获得站点的名字,url和网站描述,我们定义这三种属性的域。要做到这点,我们编辑在tutorial目录下的items.py文件,我们的Item类将会是这样

from scrapy.item import Item, Field class DmozItem(Item):    title = Field()    link = Field()    desc = Field()

刚开始看起来可能会有些困惑,但是定义这些item能让你用其他Scrapy组件的时候知道你的 items到底是什么。

 

 

我们的第一个爬虫(Spider)

Spider是用户编写的类,用于从一个域(或域组)中抓取信息。

他们定义了用于下载的URL的初步列表,如何跟踪链接,以及如何来解析这些网页的内容用于提取items。

要建立一个Spider,你必须为scrapy.spider.BaseSpider创建一个子类,并确定三个主要的、强制的属性:

  • name:爬虫的识别名,它必须是唯一的,在不同的爬虫中你必须定义不同的名字.
  • start_urls:爬虫开始爬的一个URL列表。爬虫从这里开始抓取数据,所以,第一次下载的数据将会从这些URLS开始。其他子URL将会从这些起始URL中继承性生成。
  • parse():爬虫的方法,调用时候传入从每一个URL传回的Response对象作为参数,response将会是parse方法的唯一的一个参数,

这个方法负责解析返回的数据、匹配抓取的数据(解析为item)并跟踪更多的URL。

 

这是我们的第一只爬虫的代码,将其命名为dmoz_spider.py并保存在tutorial\spiders目录下。

from scrapy.spider import BaseSpiderclass DmozSpider(BaseSpider):    name = "dmoz"    allowed_domains = ["dmoz.org"]    start_urls = [        "http://www.dmoz.org/Computers/Programming/Languages/Python/Books/",        "http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/"    ]    def parse(self, response):        filename = response.url.split("/")[-2]        open(filename, ‘wb‘).write(response.body)

 

 

爬爬爬

为了让我们的爬虫工作,我们返回项目主目录执行以下命令

T:\tutorial>scrapy crawl dmoz

crawl dmoz 命令从dmoz.org域启动爬虫。 你将会获得如下类似输出 

T:\tutorial>scrapy crawl dmoz2012-07-13 19:14:45+0800 [scrapy] INFO: Scrapy 0.14.4 started (bot: tutorial)2012-07-13 19:14:45+0800 [scrapy] DEBUG: Enabled extensions: LogStats, TelnetConsole, CloseSpider, WebService, CoreStats, SpiderState2012-07-13 19:14:45+0800 [scrapy] DEBUG: Enabled downloader middlewares: HttpAuthMiddleware, DownloadTimeoutMiddleware, UserAgentMiddleware, RetryMiddleware, DefaultHeadersMiddleware, RedirectMiddleware, CookiesMiddleware, HttpCompressionMiddleware, ChunkedTransferMiddleware, DownloaderStats2012-07-13 19:14:45+0800 [scrapy] DEBUG: Enabled spider middlewares: HttpErrorMiddleware, OffsiteMiddleware, RefererMiddleware, UrlLengthMiddleware, DepthMiddleware2012-07-13 19:14:45+0800 [scrapy] DEBUG: Enabled item pipelines:2012-07-13 19:14:45+0800 [dmoz] INFO: Spider opened2012-07-13 19:14:45+0800 [dmoz] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)2012-07-13 19:14:45+0800 [scrapy] DEBUG: Telnet console listening on 0.0.0.0:60232012-07-13 19:14:45+0800 [scrapy] DEBUG: Web service listening on 0.0.0.0:60802012-07-13 19:14:46+0800 [dmoz] DEBUG: Crawled (200) <GET http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/> (referer: None)2012-07-13 19:14:46+0800 [dmoz] DEBUG: Crawled (200) <GET http://www.dmoz.org/Computers/Programming/Languages/Python/Books/> (referer: None)2012-07-13 19:14:46+0800 [dmoz] INFO: Closing spider (finished)2012-07-13 19:14:46+0800 [dmoz] INFO: Dumping spider stats:        {‘downloader/request_bytes‘: 486,         ‘downloader/request_count‘: 2,         ‘downloader/request_method_count/GET‘: 2,         ‘downloader/response_bytes‘: 13063,         ‘downloader/response_count‘: 2,         ‘downloader/response_status_count/200‘: 2,         ‘finish_reason‘: ‘finished‘,         ‘finish_time‘: datetime.datetime(2012, 7, 13, 11, 14, 46, 703000),         ‘scheduler/memory_enqueued‘: 2,         ‘start_time‘: datetime.datetime(2012, 7, 13, 11, 14, 45, 500000)}2012-07-13 19:14:46+0800 [dmoz] INFO: Spider closed (finished)2012-07-13 19:14:46+0800 [scrapy] INFO: Dumping global stats:        {}

注意包含 [dmoz]的行 ,那对应着我们的爬虫。你可以看到start_urls中定义的每个URL都有日志行。因为这些URL是起始页面,所以他们没有引用(referrers),所以在每行的末尾你会看到 (referer: <None>). 
有趣的是,在我们的 parse  方法的作用下,两个文件被创建:分别是 Books 和 Resources,这两个文件中有URL的页面内容。 

发生了什么事情?

Scrapy为爬虫的 start_urls属性中的每个URL创建了一个 scrapy.http.Request 对象 ,并将爬虫的parse 方法指定为回调函数。 
这些 Request首先被调度,然后被执行,之后通过parse()方法,scrapy.http.Response 对象被返回,结果也被反馈给爬虫。

 

 

提取Item

选择器介绍

我们有很多方法从网站中提取数据。Scrapy 使用一种叫做 XPath selectors的机制,它基于 XPath表达式。如果你想了解更多selectors和其他机制你可以查阅资料http://doc.scrapy.org/topics/selectors.html#topics-selectors 
这是一些XPath表达式的例子和他们的含义

  • /html/head/title: 选择HTML文档<head>元素下面的<title> 标签。
  • /html/head/title/text(): 选择前面提到的<title> 元素下面的文本内容
  • //td: 选择所有 <td> 元素
  • //div[@class="mine"]: 选择所有包含 class="mine" 属性的div 标签元素

这只是几个使用XPath的简单例子,但是实际上XPath非常强大。如果你想了解更多XPATH的内容,我们向你推荐这个XPath教程http://www.w3schools.com/XPath/default.asp

为了方便使用XPaths,Scrapy提供XPathSelector 类, 有两种口味可以选择, HtmlXPathSelector (HTML数据解析) 和XmlXPathSelector (XML数据解析)。 为了使用他们你必须通过一个 Response 对象对他们进行实例化操作。你会发现Selector对象展示了文档的节点结构。因此,第一个实例化的selector必与根节点或者是整个目录有关 。 
Selectors 有三种方法

  • path():返回selectors列表, 每一个select表示一个xpath参数表达式选择的节点.
  • extract():返回一个unicode字符串,该字符串为XPath选择器返回的数据
  • re(): 返回unicode字符串列表,字符串作为参数由正则表达式提取出来

尝试在shell中使用Selectors

为了演示Selectors的用法,我们将用到 内建的Scrapy shell,这需要系统已经安装IPython (一个扩展python交互环境) 。

附IPython下载地址:http://pypi.python.org/pypi/ipython#downloads

要开始shell,首先进入项目顶层目录,然后输入

T:\tutorial>scrapy shell http://www.dmoz.org/Computers/Programming/Languages/Python/Books/

输出结果类似这样:

2012-07-16 10:58:13+0800 [scrapy] INFO: Scrapy 0.14.4 started (bot: tutorial)2012-07-16 10:58:13+0800 [scrapy] DEBUG: Enabled extensions: TelnetConsole, CloseSpider, WebService, CoreStats, SpiderState2012-07-16 10:58:13+0800 [scrapy] DEBUG: Enabled downloader middlewares: HttpAuthMiddleware, DownloadTimeoutMiddleware, UserAgentMiddleware, RetryMiddleware, DefaultHeadersMiddleware, RedirectMiddleware, CookiesMiddleware, HttpCompressionMiddleware, ChunkedTransferMiddleware, DownloaderStats2012-07-16 10:58:13+0800 [scrapy] DEBUG: Enabled spider middlewares: HttpErrorMiddleware, OffsiteMiddleware, RefererMiddleware, UrlLengthMiddleware, DepthMiddleware2012-07-16 10:58:13+0800 [scrapy] DEBUG: Enabled item pipelines:2012-07-16 10:58:13+0800 [scrapy] DEBUG: Telnet console listening on 0.0.0.0:60232012-07-16 10:58:13+0800 [scrapy] DEBUG: Web service listening on 0.0.0.0:60802012-07-16 10:58:13+0800 [dmoz] INFO: Spider opened2012-07-16 10:58:18+0800 [dmoz] DEBUG: Crawled (200) <GET http://www.dmoz.org/Computers/Programming/Languages/Python/Books/> (referer: None)[s] Available Scrapy objects:[s]   hxs        <HtmlXPathSelector xpath=None data=http://www.mamicode.com/u‘<meta http-equiv="Content-Ty‘>[s]   item       {}[s]   request    <GET http://www.dmoz.org/Computers/Programming/Languages/Python/Books/>[s]   response   <200 http://www.dmoz.org/Computers/Programming/Languages/Python/Books/>[s]   settings   <CrawlerSettings module=<module ‘tutorial.settings‘ from ‘T:\tutorial\tutorial\settings.pyc‘>>[s]   spider     <DmozSpider ‘dmoz‘ at 0x1f68230>[s] Useful shortcuts:[s]   shelp()           Shell help (print this help)[s]   fetch(req_or_url) Fetch request (or URL) and update local objects[s]   view(response)    View response in a browserWARNING: Readline services not available or not loaded.WARNING: Proper color support under MS Windows requires the pyreadline library.You can find it at:http://ipython.org/pyreadline.htmlGary‘s readline needs the ctypes module, from:http://starship.python.net/crew/theller/ctypes(Note that ctypes is already part of Python versions 2.5 and newer).Defaulting color scheme to ‘NoColor‘Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]Type "copyright", "credits" or "license" for more information.IPython 0.13 -- An enhanced Interactive Python.?         -> Introduction and overview of IPython‘s features.%quickref -> Quick reference.help      -> Python‘s own help system.object?   -> Details about ‘object‘, use ‘object??‘ for extra details.In [1]:

Shell载入后,你将获得回应,这些内容被存储在本地变量 response 中,所以如果你输入response.body 你将会看到response的body部分,或者输入response.headers 来查看它的 header部分。 
Shell也实例化了两种selectors,一个是解析HTML的  hxs 变量,一个是解析 XML 的 xxs 变量。我们来看看里面有什么:

In [1]: hxs.path(‘//title‘)Out[1]: [<HtmlXPathSelector xpath=‘//title‘ data=http://www.mamicode.com/u‘Open Directory - Computers: Progr‘>]><div></div></div><p> </p><p> </p><p><strong>提取数据</strong></p><p>现在我们尝试从网页中提取数据。 <br />你可以在控制台输入 response.body, 检查源代码中的 XPaths 是否与预期相同。然而,检查HTML源代码是件很枯燥的事情。为了使事情变得简单,我们使用Firefox的扩展插件Firebug。更多信息请查看<em>Using Firebug for scraping </em><em>和</em><em>Using Firefox for scraping.</em><br />txw1958注:事实上我用的是Google Chrome的Inspect Element功能,而且可以提取元素的XPath。<br />检查源代码后,你会发现我们需要的数据在一个 <ul>元素中,而且是第二个<ul>。 <br />我们可以通过如下命令选择每个在网站中的 <li> 元素:</p><div><pre class="shadow-none p-3 mb-5 bg-light rounded">hxs.path(‘//ul/li‘) </pre></div><p>然后是网站描述:</p><div><pre class="shadow-none p-3 mb-5 bg-light rounded">hxs.path(‘//ul/li/text()‘).extract()</pre></div><p>网站标题:</p><div><pre class="shadow-none p-3 mb-5 bg-light rounded">hxs.path(‘//ul/li/a/text()‘).extract()</pre></div><p>网站链接:</p><div><pre class="shadow-none p-3 mb-5 bg-light rounded">hxs.path(‘//ul/li/a/@href‘).extract()</pre></div><p>如前所述,每个path()调用返回一个selectors列表,所以我们可以结合path()去挖掘更深的节点。我们将会用到这些特性,所以:</p><div><div></div><pre class="shadow-none p-3 mb-5 bg-light rounded">sites = hxs.path(‘//ul/li‘)for site in sites:    title = site.path(‘a/text()‘).extract()    link = site.path(‘a/@href‘).extract()    desc = site.path(‘text()‘).extract()    print title, link, desc</pre><div></div></div><p> </p><p>Note <br />更多关于嵌套选择器的内容,请阅读<em>Nesting selectors</em> 和 <em>Working with relative XPaths</em></p><p>将代码添加到爬虫中:</p><p>txw1958注:代码有修改,绿色注释掉的代码为原教程的,你懂的</p><div><div></div><pre class="shadow-none p-3 mb-5 bg-light rounded">from scrapy.spider import BaseSpiderfrom scrapy.selector import HtmlXPathSelectorclass DmozSpider(BaseSpider):    name = "dmoz"    allowed_domains = ["dmoz.org"]    start_urls = [        "http://www.dmoz.org/Computers/Programming/Languages/Python/Books/",        "http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/"]          def parse(self, response):        hxs = HtmlXPathSelector(response)        sites = hxs.path(‘//fieldset/ul/li‘)        #sites = hxs.path(‘//ul/li‘)        for site in sites:            title = site.path(‘a/text()‘).extract()            link = site.path(‘a/@href‘).extract()            desc = site.path(‘text()‘).extract()            #print title, link, desc            print title, link</pre><div></div></div><p>现在我们再次抓取dmoz.org,你将看到站点在输出中被打印 ,运行命令</p><div><pre class="shadow-none p-3 mb-5 bg-light rounded">T:\tutorial>scrapy crawl dmoz</pre></div><p> </p><p> </p><p><strong>使用条目</strong><strong>(Item)</strong></p><p>Item 对象是自定义的python字典,使用标准字典类似的语法,你可以获取某个字段(即之前定义的类的属性)的值:</p><div><pre class="shadow-none p-3 mb-5 bg-light rounded">>>> item = DmozItem() >>> item[‘title‘] = ‘Example title‘ >>> item[‘title‘] ‘Example title‘ </pre></div><p>Spiders希望将其抓取的数据存放到Item对象中。为了返回我们抓取数据,spider的最终代码应当是这样:</p><div><div></div><pre class="shadow-none p-3 mb-5 bg-light rounded">from scrapy.spider import BaseSpiderfrom scrapy.selector import HtmlXPathSelectorfrom tutorial.items import DmozItemclass DmozSpider(BaseSpider):   name = "dmoz"   allowed_domains = ["dmoz.org"]   start_urls = [       "http://www.dmoz.org/Computers/Programming/Languages/Python/Books/",       "http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/"   ]   def parse(self, response):       hxs = HtmlXPathSelector(response)       sites = hxs.path(‘//fieldset/ul/li‘)       #sites = hxs.path(‘//ul/li‘)       items = []       for site in sites:           item = DmozItem()           item[‘title‘] = site.path(‘a/text()‘).extract()           item[‘link‘] = site.path(‘a/@href‘).extract()           item[‘desc‘] = site.path(‘text()‘).extract()           items.append(item)       return items</pre><div></div></div><p>现在我们再次抓取 : </p><div><div></div><pre class="shadow-none p-3 mb-5 bg-light rounded">2012-07-16 14:52:36+0800 [dmoz] DEBUG: Scraped from <200 http://www.dmoz.org/Computers/Programming/Languages/Python/Books/>        {‘desc‘: [u‘\n\t\t\t\n\t‘,                  u‘ \n\t\t\t\n\t\t\t\t\t\n - Free Python books and tutorials.\n \n‘],         ‘link‘: [u‘http://www.techbooksforfree.com/perlpython.shtml‘],         ‘title‘: [u‘Free Python books‘]}2012-07-16 14:52:36+0800 [dmoz] DEBUG: Scraped from <200 http://www.dmoz.org/Computers/Programming/Languages/Python/Books/>        {‘desc‘: [u‘\n\t\t\t\n\t‘,                  u‘ \n\t\t\t\n\t\t\t\t\t\n - Annotated list of free online books on Python scripting language. Topics range from beginner to advanced.\n \n          ‘],         ‘link‘: [u‘http://www.freetechbooks.com/python-f6.html‘],         ‘title‘: [u‘FreeTechBooks: Python Scripting Language‘]}2012-07-16 14:52:36+0800 [dmoz] DEBUG: Crawled (200) <GET http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/> (referer: None)2012-07-16 14:52:36+0800 [dmoz] DEBUG: Scraped from <200 http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/>        {‘desc‘: [u‘\n\t\t\t\n\t‘,                  u‘ \n\t\t\t\n\t\t\t\t\t\n - A directory of free Python and Zope hosting providers, with reviews and ratings.\n \n‘],         ‘link‘: [u‘http://www.oinko.net/freepython/‘],         ‘title‘: [u‘Free Python and Zope Hosting Directory‘]}2012-07-16 14:52:36+0800 [dmoz] DEBUG: Scraped from <200 http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/>        {‘desc‘: [u‘\n\t\t\t\n\t‘,                  u‘ \n\t\t\t\n\t\t\t\t\t\n - Features Python books, resources, news and articles.\n \n‘],         ‘link‘: [u‘http://oreilly.com/python/‘],         ‘title‘: [u"O‘Reilly Python Center"]}2012-07-16 14:52:36+0800 [dmoz] DEBUG: Scraped from <200 http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/>        {‘desc‘: [u‘\n\t\t\t\n\t‘,                  u‘ \n\t\t\t\n\t\t\t\t\t\n - Resources for reporting bugs, accessing the Python source tree with CVS and taking part in the development of Python.\n\n‘],         ‘link‘: [u‘http://www.python.org/dev/‘],         ‘title‘: [u"Python Developer‘s Guide"]}</pre><div></div></div><p><br /> </p><p><strong>保存抓取的数据</strong></p><p>保存信息的最简单的方法是通过<em>Feed exports</em>,命令如下:</p><div><pre class="shadow-none p-3 mb-5 bg-light rounded">T:\tutorial>scrapy crawl dmoz -o items.json -t json</pre></div><p>所有抓取的items将以JSON格式被保存在新生成的items.json 文件中<br /><br />在像本教程一样的小型项目中,这些已经足够。然而,如果你想用抓取的items做更复杂的事情,你可以写一个 Item Pipeline(条目管道)。因为在项目创建的时候,一个专门用于条目管道的占位符文件已经随着items一起被建立,目录在tutorial/pipelines.py。如果你只需要存取这些抓取后的items的话,就不需要去实现任何的条目管道。</p><p><br /><br /><strong>结束语</strong></p><p>本教程简要介绍了Scrapy的使用,但是许多其他特性并没有提及。</p><p>对于基本概念的了解,请访问<em>Basic concepts</em></p><p>我们推荐你继续学习Scrapy项目的例子dirbot,你将从中受益更深,该项目包含本教程中提到的dmoz爬虫。</p><p>Dirbot项目位于https://github.com/scrapy/dirbot</p><p>项目包含一个README文件,它详细描述了项目的内容。</p><p>如果你熟悉git,你可以checkout它的源代码。或者你可以通过点击Downloads下载tarball或zip格式的文件。</p><p>另外这有一个代码片断共享网站,里面共享内容包括爬虫,中间件,扩展应用,脚本等。网站名字叫Scrapy snippets,有好的代码要记得共享哦:-)</p><p> </p><p>文件源码附件稍后上传……</p><p><strong> </strong></p><p>python之scrapy入门教程</p></span>
</div>
<nav class="p-0 mb-4 bg-white text-left">
<a href="/itag/60/" title="des" class="tag" target="_blank">des</a> <a href="/itag/13/" title="blog" class="tag" target="_blank">blog</a> <a href="/itag/2/" title="http" class="tag" target="_blank">http</a> <a href="/itag/736/" title="io" class="tag" target="_blank">io</a> <a href="/itag/743/" title="ar" class="tag" target="_blank">ar</a> </nav>

<div class="alert alert-secondary alert-dismissible fade show font-weight-light" role="alert">
<i class="bi bi-info-square-fill"></i> 声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉:<a class="badge badge-dark font-weight-light" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo" href="#"><i class="bi bi-envelope"></i> 投诉/举报</a> 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>

<div class="alert alert-secondary alert-dismissible fade show" role="alert">
<form name='feedback' method='post' enctype='multipart/form-data' action='#'>
<input name='enews' type='hidden' value='AddFeedback'>
<input type="hidden" name="bid" value="2" />
<input type='hidden' name='ecmsfrom' value='https://www.ouer.net/daima/nd5h2.html'>
<div class="mb-3">
<label for="address"><h6><strong><i class="bi bi-chat-right-text-fill"></i> 看完仍有疑问?有类似问题直接问程序猿</strong></h6></label>
<textarea class="form-control" aria-label="With textarea" name="saytext" style="height: 120px;" required placeholder="提问和评论都可以,用心的回复会被更多人看到和认可!"></textarea>
</div>
<button class="btn btn-primary btn-lg btn-block" type='submit' name='submit'>发布提问</button></form>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>



<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">投诉/举报</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        <form name='feedback' method='post' enctype='multipart/form-data' action='../../e/enews/index.php'>
<input name='enews' type='hidden' value='AddFeedback'>
<input type="hidden" name="bid" value="2" />
<input type='hidden' name='ecmsfrom' value='https://www.u72.net/daima/nd5h2.html'>
<input name='title' type='hidden' value='https://www.u72.net/daima/nd5h2.html'>
       <div class="mb-3">
          <div class="input-group">
            <div class="input-group-prepend">
            <span class="input-group-text"><i class="bi bi-pencil-square"></i></span>
            </div>
            <input class="form-control" type="text" placeholder="python之scrapy入门教程..." readonly>
          </div>
        </div>
       <div class="mb-3">
          <label for="username"><h5><i class="bi bi-person-lines-fill"></i> 您的姓名</h5></label>
          <div class="input-group">
            <div class="input-group-prepend">
            <span class="input-group-text"><i class="bi bi-person-check"></i></span>
            </div>
          <input class="form-control form-control" type="text" name="name">
          </div>
        </div>
        <div class="mb-3">
          <label for="address"><h5><i class="bi bi-chat-left-text"></i> 反馈内容</h5></label>
          <textarea class="form-control form-control" aria-label="With textarea" name="saytext" style="height: 130px;" required></textarea>
        </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
        <button type="submit" name="submit" class="btn btn-primary">提交内容</button>
      </div>
      </form>
    </div>
  </div>
</div>
</div>
<p class="social-share"  data-disabled="google,twitter,facebook,tencent,diandian" ></p>
<p class="text-left"><button type="button" class="itemCopy btn btn-light" id="TKLS"  type="button" data-clipboard-text="https://www.u72.net/daima/nd5h2.html"><i class="bi bi-link-45deg"></i> https://www.u72.net/daima/nd5h2.html</button></p>

</div>

<br>
<nav class="blog-pagination">
<p class="text-left"></p> 
</nav>
</div>
<aside class="col-md-4 blog-sidebar">
<div class="mb-3 bg-light rounded list-group">
<a href="#" class="list-group-item list-group-item-action active">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1"><i class="bi bi-building"></i> 相关代码解决方案</h5>
</div>
</a>
<a href="/daima/u67d.html" title="Scrapy入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Scrapy入门教程</h6></div></a><a href="/daima/nvxee.html" title="Scrapy入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Scrapy入门教程</h6></div></a><a href="/daima/nv709.html" title="python教程,python入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> python教程,python入门教程</h6></div></a><a href="/daima/kcbb.html" title="[转发]Python入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> [转发]Python入门教程</h6></div></a><a href="/daima/nfd15.html" title="Python简单入门教程helloworld" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Python简单入门教程helloworld</h6></div></a><a href="/daima/cxm8.html" title="Python3.1-Numpy模块之入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Python3.1-Numpy模块之入门教程</h6></div></a><a href="/daima/nv6z7.html" title="Python怎么样入门?Python基础入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Python怎么样入门?Python基础入门教程</h6></div></a><a href="/daima/62n.html" title="Iptables入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Iptables入门教程</h6></div></a><a href="/daima/nxak.html" title="SharpMap入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> SharpMap入门教程</h6></div></a><a href="/daima/xaz.html" title="Groovy入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Groovy入门教程</h6></div></a><a href="/daima/ubc.html" title="MySQL 入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> MySQL 入门教程</h6></div></a><a href="/daima/vdm.html" title="编程入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> 编程入门教程</h6></div></a><a href="/daima/ze19.html" title="Maven入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Maven入门教程</h6></div></a><a href="/daima/zhsb.html" title="gulp入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> gulp入门教程</h6></div></a><a href="/daima/zkcu.html" title="JSON入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> JSON入门教程</h6></div></a><a href="/daima/ne08.html" title="RMI入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> RMI入门教程</h6></div></a><a href="/daima/h1b4.html" title="Grunt入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Grunt入门教程</h6></div></a><a href="/daima/kfud.html" title="bower入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> bower入门教程</h6></div></a><a href="/daima/d9k2.html" title="angularjs 入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> angularjs 入门教程</h6></div></a><a href="/daima/kekc.html" title="Swift 入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Swift 入门教程</h6></div></a><a href="/daima/kwfe.html" title="MySQL 入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> MySQL 入门教程</h6></div></a><a href="/daima/s11z.html" title="Maven入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Maven入门教程</h6></div></a><a href="/daima/vbsc.html" title="MySQL 入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> MySQL 入门教程</h6></div></a><a href="/daima/vbs5.html" title="bash入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> bash入门教程</h6></div></a><a href="/daima/vd10.html" title="OpenCV入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> OpenCV入门教程</h6></div></a><a href="/daima/3fv4.html" title="maven入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> maven入门教程</h6></div></a><a href="/daima/2wan.html" title="Hive入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> Hive入门教程</h6></div></a><a href="/daima/1xmh.html" title="TestNG 入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> TestNG 入门教程</h6></div></a><a href="/daima/6r3u.html" title="MagicalRecord入门教程" class="list-group-item list-group-item-action" target="_blank"><div class="d-flex w-100 justify-content-between"><h6 class="mb-1"><img class="icon" src="/skin/law/images/icon-answer.svg" width="22" height="22"> MagicalRecord入门教程</h6></div></a></div>

<div class="p-4 mb-3 bg-light rounded">
<h4>当日更新</h4>
<ul class="list-group list-group-flush mb-0"><li class="list-group"><a href="/daima/n0535.html" title="创建tabBarControllers视图控制器的方法" target="_blank"><i class="bi bi-question-square-fill"></i> 创建tabBarControllers视图</a></li>
<li class="list-group"><a href="/daima/n0534.html" title="ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction" target="_blank"><i class="bi bi-question-square-fill"></i> ERROR 1205 (HY000): Lock w</a></li>
<li class="list-group"><a href="/daima/n0533.html" title="HDU 1728 逃离迷宫 DFS+标记转弯数+优化" target="_blank"><i class="bi bi-question-square-fill"></i> HDU 1728 逃离迷宫 DFS+标记</a></li>
<li class="list-group"><a href="/daima/n0532.html" title="UICollectionViewController使用问题之UICollectionViewFlowLayout" target="_blank"><i class="bi bi-question-square-fill"></i> UICollectionViewController</a></li>
<li class="list-group"><a href="/daima/n0531.html" title="关于柔性数组的一些问题" target="_blank"><i class="bi bi-question-square-fill"></i> 关于柔性数组的一些问题</a></li>
<li class="list-group"><a href="/daima/n0530.html" title="Windows RT 应用程序开发介绍培训的讲义" target="_blank"><i class="bi bi-question-square-fill"></i> Windows RT 应用程序开发介</a></li>
<li class="list-group"><a href="/daima/n053x.html" title="白鹭引擎和layabox哪个好用,哪个技术更成熟 ?" target="_blank"><i class="bi bi-question-square-fill"></i> 白鹭引擎和layabox哪个好用,</a></li>
<li class="list-group"><a href="/daima/n053w.html" title="2015.1.29试题笔记" target="_blank"><i class="bi bi-question-square-fill"></i> 2015.1.29试题笔记</a></li>
<li class="list-group"><a href="/daima/n053v.html" title="进击的Python【第十二章】:mysql介绍与简单操作,sqlachemy介绍与简单应用" target="_blank"><i class="bi bi-question-square-fill"></i> 进击的Python【第十二章】:my</a></li>
<li class="list-group"><a href="/daima/n053u.html" title="滚动优化" target="_blank"><i class="bi bi-question-square-fill"></i> 滚动优化</a></li>
</ul>
</div>

</aside>
</div>

<div class="floatbar">
        <div class="floatbar-item">
            <a href="/fankui.html" target="_blank" class="floatbar-btn">
                <i>
                  <i class="bi bi-chat-right-text"></i>
                </i>
                <p>
                    联系<br>
                    我们
                </p>
            </a>
        </div>

        <div class="floatbar-item floatbtn-item-top" style="display: none;">
            <a href="javascript:" class="floatbar-btn backtotop">
                <i>
                <i class="bi bi-chevron-double-up"></i>
                </i>
                <p>
                    回到<br>
                    顶部
                </p>
            </a>
        </div>
    </div>
<header>
</header>

</main>
<!-- /.container -->
<script src="/skin/law/top/js/toastr.min.js"></script>
<script src="/skin/law/top/js/site.js"></script>
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
  <a class="navbar-brand" href="#">友情链接:</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
    <div class="navbar-nav">
<a class="nav-link" href="https://www.xuebavip.cn">学霸VIP</a>
    </div>
  </div>
</nav>
</div>

<div id="loginbox"></div>
<div class="container">     
<footer class="pt-4 my-md-3 pt-md-5 border-top text-center font-weight-light">
<p class="mb-1"><a href="/about/nbs.html" class="text-dark">关于我们</a> / <a href="/about/nbv.html" class="text-dark">广告服务</a> / <a href="/about/nbu.html" class="text-dark">免责声明</a></p>
<p class="mb-1">若内容有误或涉及侵权不想在本站出现!</p>
<p class="mb-1"><a class="badge badge-dark font-weight-light" href="/fankui.html"><i class="bi bi-envelope"></i> 请联系我们</a> 我们会及时处理和回复!</p>
<p class="mb-1">Copyright © 2022 程序员工具箱 All Rights Reserved  <a target="_blank" href="https://beian.miit.gov.cn" rel="nofollow" class="text-dark">蜀ICP备14004987号</a>  </p>
</footer>
</div>
<script src="/skin/law/bootstrap4.6.1/js/clipboard.min.js"></script>
<script>
var clipboard = new Clipboard('.itemCopy');
clipboard.on('success',
function(e) {
    if (e.trigger.disabled == false || e.trigger.disabled == undefined) {
        e.trigger.innerHTML = "本问题链接复制成功";
        e.trigger.disabled = true;
        setTimeout(function() {
            e.trigger.innerHTML = "本问题链接一键复制";
            e.trigger.disabled = false;
        },
        2000);
    }
});
clipboard.on('error',
function(e) {
    e.trigger.innerHTML = "复制失败";
});
</script>
<script src="/e/extend/DoTimeRepage/"></script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?f2555e186a2326f28ced45c12daae1cb";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>