<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          GoldDataSpider網(wǎng)頁數(shù)據(jù)抽取工具

          聯(lián)合創(chuàng)作 · 2023-09-29 13:45

          GoldDataSpider 是用于抓取網(wǎng)頁和抽取數(shù)據(jù)的工具。其核心代碼是從金色數(shù)據(jù)抓取融合平臺分離而來。

          該項目提供抓取和抽取來自網(wǎng)頁數(shù)據(jù),不僅可以抽取網(wǎng)頁內(nèi)的內(nèi)容,還能抽取URL、HTTP報頭、Cookie里的數(shù)據(jù)。

          該項目定義了一種簡潔、靈活、敏捷的結(jié)構(gòu)或者說是規(guī)則語法。極盡其所能將網(wǎng)頁內(nèi)容、HTTP報頭、Cookie、甚至關(guān)聯(lián)其它網(wǎng)頁、其它網(wǎng)站數(shù)據(jù),抽取出有意義有價值數(shù)據(jù)字段,組成一條數(shù)據(jù)記錄。除此之外,還能內(nèi)嵌http請求,以補充數(shù)據(jù)字段,比如某些字段需要向詞典提供翻譯這樣的字段等等。

          該項目還可支持從各種類型文檔抽取數(shù)據(jù),比如html/xml/json/javascript/text等。
           

          我們還提供了規(guī)則可視化配制,請下載采集數(shù)量不受限、爬蟲數(shù)量不受限、導(dǎo)出數(shù)據(jù)數(shù)量不受限的完全免費金色數(shù)據(jù)平臺社區(qū)版 。以及詳盡的文檔

          使用入門

          首先,我們需要將依賴加入項目當(dāng)中,如下:

          1、對于maven項目

          <dependency>
            <groupId>com.100shouhou.golddata</groupId>
            <artifactId>golddata-spider</artifactId>
            <version>1.1.3</version>
          </dependency>

          2、對于gradle項目

           compile group: 'com.100shouhou.golddata', name: 'golddata-spider', version: '1.1.3'

          然后你將可以使用該依賴所提供的簡潔清晰的API,如下:

          @Test
          public void testGoldSpider(){
              String ruleContent=
                      "    {                                                      \n"+
                      "      __node: li.sky.skyid                                 \n"+
                      "      date:                                                \n"+
                      "      {                                                    \n"+
                      "        expr: h1                                           \n"+
                      "        __label: 日期                                      \n"+
                      "      }                                                    \n"+
                      "      sn:                                                  \n"+
                      "      {                                                    \n"+
                      "                                                           \n"+
                      "        js: md5(baseUri+item.date+headers['Content-Type']);\n"+
                      "      }                                                    \n"+
                      "      weather:                                             \n"+
                      "      {                                                    \n"+
                      "        expr: p.wea                                        \n"+
                      "      }                                                    \n"+
                      "      temprature:                                          \n"+
                      "      {                                                    \n"+
                      "        expr: p.tem>i                                      \n"+
                      "      }                                                    \n"+
                      "    }                                                      \n";
              GoldSpider spider= com.xst.golddata.GoldSpider.newSpider()
                      .setUrl("http://www.weather.com.cn/weather/101020100.shtml")
                      .setRule(ruleContent)
                      .request();
              List list=spider.extractList();
              // List<Weather> weathers=spider.extractList(Weather.class);
              // Weather weathers=spider.extractFirst(Weather.class);
             list.forEach( System.out::println);
          }

          運行上面的測試,你將可以看類似下面的輸出:

          {date=19日(今天), weather=陰轉(zhuǎn)小雨, temprature=10℃, sn=8bc265cb2bf23b6764b75144b255d81d}
          {date=20日(明天), weather=小雨轉(zhuǎn)多云, temprature=11℃, sn=9efd7e7bbbfb9bb06e04c0c990568bfd}
          {date=21日(后天), weather=多云轉(zhuǎn)中雨, temprature=11℃, sn=728539ac882721187741708860324afa}
          {date=22日(周六), weather=小雨, temprature=9℃, sn=a23fa2233e750a3bdd11b2e200ed06c3}
          {date=23日(周日), weather=小雨轉(zhuǎn)多云, temprature=8℃, sn=b27e1b8a8e92a7bed384ceb3e4fdfb5f}
          {date=24日(周一), weather=多云轉(zhuǎn)小雨, temprature=8℃, sn=c142b7fd12330ca031dd96b307c0d50d}
          {date=25日(周二), weather=小雨轉(zhuǎn)中雨, temprature=6℃, sn=16f71d3c8f09394588532a3ed1a8bacf}

          當(dāng)作Service或者API使用

          你可以在項目中,可以當(dāng)作調(diào)用服務(wù)和API使用。例如如下:

          @Service
          public class WeatherServiceImpl implements WeatherService{
          
          	public List<Weather> listByCityId(Long cityId){
          		String url="http://www.weather.com.cn/weather/"+cityId+".shtml"
          	    String rule="<同上>"
          		GoldSpider spider= com.xst.golddata.GoldSpider.newSpider()
          						.setUrl(url)
          						.setRule(ruleContent)
          						.request();
                      
                  return spider.extractList(Weather.class);    
          	}
          }

          對于可視化配制,可以參考免費社區(qū)版文檔。以下就免費社區(qū)版做簡單介紹 ,詳情見官網(wǎng)!


          免費社區(qū)版:

          開源/免費

          讓用戶更好理解和使用產(chǎn)品

          我們針對數(shù)據(jù)采集免費,還開放和維護(hù)核心的開源代碼項目。讓用戶可以更好的使用、理解采集,用好采集。 讓用戶在各種場景應(yīng)用金色數(shù)據(jù)采集帶來的便利,我們有信心讓客戶見到一個開放的數(shù)據(jù)平臺,讓用戶放心/省心/省力。

          自由/靈活

          透出一股強大的采集核心

          我們的采集器,將向用戶暴露一切目標(biāo)數(shù)據(jù),除了常規(guī)網(wǎng)頁內(nèi)容,還有如URL、HTTP報頭、Cookie等。還提供了各種解析工具和函數(shù),讓用戶不僅能得到網(wǎng)頁內(nèi)容里的數(shù)據(jù),還能得到URL、HTTP報頭、Cookie里隱藏的核心數(shù)據(jù),還能靈活做到智能防封。

          分布式采集

          私有云,更靈活,更安全,更放心

          可以根據(jù)自身需求,隨意部署采集器數(shù)量,7*24小時不間斷運行,采集后端集中靈活控制??勺杂芍笓]數(shù)據(jù)在哪個采集器采集??啥x定時采集,無需人員值守。

          數(shù)據(jù)可關(guān)聯(lián)可追蹤

          恢復(fù)/重建數(shù)據(jù)內(nèi)在與外在價值

          可以讓每條數(shù)據(jù)隨著目標(biāo)網(wǎng)站目標(biāo)內(nèi)容更新(如商品價格)、而更新用戶應(yīng)用表該條數(shù)據(jù)相關(guān)字段內(nèi)容。

          非侵入式融合

          融合從未如此現(xiàn)實和簡單

          完全可以在不改變用戶應(yīng)用表結(jié)構(gòu)(增刪改表列),而將采集數(shù)據(jù)融入到應(yīng)用表中。

          自動化/一體化

          無需人力操作,即抓即用

          不只是采集可以自動化抓取,融合也提供了手動化和強大自動化功能。還將采集與融合操作無縫對接,可將目標(biāo)數(shù)據(jù)抓一條融合一條,實時流向應(yīng)用表,做到即抓即用!
          瀏覽 31
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  午夜麻豆91视频 | 97久久一区二区三区 | 亚洲日韩欧美综合热 | 猛操女神 | 精品无码三级在线播放 |