<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ~~~ # -*- coding: utf-8 -*- import scrapy # 導入模型item from scrapy_demo.items import ScrapyDemoItem class ItcastSpider(scrapy.Spider): # 一個scrapy項目可以有多個爬蟲,name是其唯一標識,同一項目不能有同名的爬蟲 name = 'itcast' allowed_domains = ['itcast.cn'] # 爬蟲的起始爬蟲點 start_urls = ['http://www.itcast.cn/channel/teacher.shtml'] # 一個頁面下載完,scrapy引擎會回調一個我們指定的頁面解析函數(默認parse) # 解析函數通常完成兩個任務: # 提取頁面中的數據(使用xpath或css選擇器) # 提取頁面中的鏈接,并產生對鏈接頁面的下載請求 # 頁面解析函數通常被實現成一個生成器函數,每一項從頁面中提取的數據以及每一個對鏈接頁面的下載請求都???yield語句提交給scrapy引擎 def parse(self, response): node_list = response.xpath('//div[@class="li_txt"]') for node in node_list: name = node.xpath('./h3/text()').extract()[0] title = node.xpath('./h4/text()').extract()[0] desc = node.xpath('./p/text()').extract()[0] item = ScrapyDemoItem() item['name'] = name item['title'] = title item['desc'] = desc yield item ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看