<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ![](https://box.kancloud.cn/4eec068d817dd460cc83000ccf882fe4_709x395.png) ![](https://box.kancloud.cn/de4f23298125a5629537dfbf7dab413f_838x262.png) ![](https://box.kancloud.cn/9b2611cd2adea3efbf8fb64cc851a637_826x294.png) 1. | 或 `//tr[@class="odd"]|//tr[@class="even"]` ![](https://box.kancloud.cn/b941179398cb9d6451f08993e0b45aaf_1344x429.png) 2. 在xpath中取數組的值,從1開始 例如 : `// 表示任意路徑` ~~~ <tr class="even"> <td class="l square"> # //tr[@class="odd"]|//tr[@class="even"]/td[1] <a target="_blank" href="position_detail.php?id=33102&keywords=&tid=0&lid=0">SNG04-后臺開發工程師(上海)</a> <span class="hot"/> </td> <td>技術類</td> # //tr[@class="odd"]|//tr[@class="even"]/td[2] <td>1</td> # //tr[@class="odd"]|//tr[@class="even"]/td[3] <td>上海</td> # //tr[@class="odd"]|//tr[@class="even"]/td[4] <td>2017-09-27</td> # //tr[@class="odd"]|//tr[@class="even"]/td[5] </tr> <tr class="odd"> <td class="l square"> <a target="_blank" href="position_detail.php?id=33104&keywords=&tid=0&lid=0">21228-MMORPG運營分析(深圳)</a> </td> <td>產品/項目類</td> <td>1</td> <td>深圳</td> <td>2017-09-27</td> </tr> ~~~ ~~~ def parse(self, response): teacher_list = response.xpath('//tr[@class="odd"]|//tr[@class="even"]') for each in teacher_list: item = tecentItem() # 不加extract() 結果為xpath匹配對象 try: # 從1開始提取列表 position_name = each.xpath('./td[1]/a/text()').extract()[0] position_type = each.xpath('./td[2]/text()').extract()[0] # title location = each.xpath('./td[4]/text()').extract()[0] # info time = each.xpath('./td[5]/text()').extract()[0] detail = each.xpath('./td[1]/a/@href').extract()[0] item['position_type'] = position_type item['position_name'] = position_name item['location'] = location item['publish_time'] = time item['detail'] = "http://hr.tencent.com/" + detail yield item # 生成器 except: pass if self.offset < 2250: self.offset +=10 print("第幾頁" + self.url+str(self.offset)) else: os._exit(0) # 向引擎請求,引擎把請求發送給調度器,入隊列,出隊列,交給下載器下載 #從其實url開始,然后請求其他頁的數據,返回數據是生成器 yield scrapy.Request(url=self.url+str(self.offset),callback=self.parse) # callback 是指有響應,就交給parse方法 ~~~ *
                  <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>

                              哎呀哎呀视频在线观看