【正文】
try nodelist parserparse attributes_filter catch ParserException e eprintStackTrace return 3 得到了所有的 a 標簽集合這些集合都存儲在 nodelist 中循環(huán)遍歷集合得到 URL并把 URL通過 addLinkFromStringfor int i 0 i nodelistsize i LinkTag aNode LinkTag nodelistelementAt i String url aNodegetLink addLinkFromString curi url LinkNAVLINK_HOP 43 下 載 WSDL 文檔 在爬蟲抓取過程中如果抓取到了服務 WSDL文檔的 URL就下載 WSDL文檔具體過程是首先得到利用 HTTPClient工具對 WSDL文檔進行連接并得到 inputStream然后就是在本地磁盤上新建一個文件最后把流中的內容寫入文件中代碼如下 得到遠程服務器返回 WSDL 文檔的輸入流 ReplayInputStream replayis recisgetContentReplayInputStream 在硬盤中新建一個文件 File tf new File destgetPath FileOutputStream fos new FileOutputStream tf try 把返回的 WSDL 文檔內容寫入硬盤文件中 replayisreadFullyTo fos finally 關閉返回輸入流和文件流 fosclose replayisclose 44 結果展示 下面介紹爬蟲啟動過程及爬蟲抓取的中間結果最后介紹爬蟲最終抓取結果首先介紹爬蟲啟動過程 1 點擊 jar 文件彈出命令行窗 口顯示爬蟲版本信息 2 打開瀏覽器輸入 localhost8080 并 輸 入 用戶 名 和 密 碼adminadmin 3 點擊 Jobs 標簽在新頁面點擊 with defaults 顯示新任務設置頁面 4 在頁面中輸入 Name of new jobdescriptionseeds 5 然后點擊 Modules 標簽進入新頁面如圖 48 和 49 所示 51 在 select crawl scope 選項中選擇 BroadScope 并點擊 change按鈕 52 在 Select Extractors 選項中依次刪除 ExtractorHTML ExtractorCSSExtractorJSExtractorSWF 53 在 Select Extractors 選項中添加 daExtractor 54 在 Select Post Processors 選項中刪除 FrontierScheduler并添加 FrontierSchedulerForSeekda 圖 48 設置 module 頁面 1 圖 49 設置 module 頁 面 2 6. setting 標簽進入?yún)?shù)設置頁面 61 在 useragent 處修改為 Mozilla50 patible heritrix 1 62 在 from 處修改為 useruser 63 在 retries處修改為 5 在 retrydelayseconds處修改為 60 執(zhí)行完以上 6 步后點擊 submit jobconsole 頁面點擊 start 按鈕爬蟲就開始運行了爬蟲運行的中間結果如圖 410 所示 圖 410 爬蟲運行中間結果 爬蟲運行最終結果是 seekda 網(wǎng)站的抓取過程花費了大約 2 天的時間抓取到了 21273 個服務這些服務中能夠下載 WSDL 文檔的服務有 17255 個下載的服務信息存儲在數(shù)據(jù)庫中如圖 411 所示 圖 411 數(shù)據(jù)庫存儲內容展示 第五章 總結和展望 51 論文總結 本系統(tǒng)的目標是搜集網(wǎng)絡上的服務包括服務 WSDL 文檔服務提供商服務可用率等信息本文首先分析了網(wǎng)絡上服務的分布情況一部分網(wǎng)站提供了服務詳細信息其他網(wǎng)站只提供了 Web 服務的 WSDL 文檔的 URL 根據(jù)分析結果本系統(tǒng)采用的抓取方 法包括以下兩種 第一種對于提供了服務詳細信息的網(wǎng)站首先分析得到注冊網(wǎng)站的服務分布結構然后爬蟲根據(jù)服務分布結構依次循環(huán)遍歷網(wǎng)站在遍歷過程中把服務詳細信息抓取下來并存入數(shù)據(jù)庫 第二種對于沒有提供服務詳細信息的網(wǎng)站把網(wǎng)站首頁作為爬蟲源 URL爬蟲線程對每一個待訪問隊列中的 URL進行 3個處理鏈的處理從網(wǎng)頁中提取所有a 標簽中的 url 并排除非本網(wǎng)站的 URL 把剩下的 URL 加入到待訪問隊列中當遇到服務 WSDL 的 URL 時下載該 WSDL 文檔當待訪問隊列為空時爬蟲抓取過程結束 本系統(tǒng)對 Seekda 網(wǎng)站上的服務進行抓 取大概用了 2 天時間抓取了 21273 個服務下載了 17255 個 WSDL 文檔并把服務相關信息存入數(shù)據(jù)庫 52 存在的問題和展望 因為互聯(lián)網(wǎng)上服務分布情況比較復雜服務的發(fā)布地點不同提供的詳細信息也不同所以抓取互聯(lián)網(wǎng)上的服務 WSDL 文檔及服務信息就不可能采用同一個抓取流程和提取頁面內容方法本論文是對每個網(wǎng)站制作一個抓取流程和提取頁面內容方法但是當對新的服務注冊網(wǎng)站進行抓取時就需要重新編寫抓取流程和抓取頁面內容方法 如果服務注冊網(wǎng)站數(shù)量不斷增加那么本系統(tǒng)也要不斷擴展并不能實現(xiàn)全自動抓取任務 要實現(xiàn)一個抓取流程和 提取頁面內容方法就可以抓取互聯(lián)網(wǎng)上所有的服務WSDL 文檔及服務信息可以讓服務提供者把服務相關的信息寫入 WSDL 文檔因為WSDL的 URL絕大部分是以 wsdl結尾的那么爬蟲程序就可以遍歷所有網(wǎng)站只抓取WSDL的 URL就不需要根據(jù)網(wǎng)頁結構來提取服務詳細信息服務詳細信息從 WSDL文檔中就可以得到 參考文獻 [1]seeda 網(wǎng)站 webserv [2]網(wǎng)絡爬蟲 [EBOL] bview284853htm [3]孫立偉何國輝吳禮發(fā)網(wǎng)絡爬蟲技術研究 Computer Knowledge and Technology 電腦知識與技術 Vol4No15May 2021pp41124115 [4]J Cho H GarciaMolina The evolution of the web and implications for an incremental crawler [C] In Proceedings of the 26th International Conference on Very Large Database Cairo Egypt 2021 [5]Roberston L Anecdotes [Google search engine] [J] Annals of the History of Computing 2021 Volume 27 9697 [6]陳汶濱基于聚焦爬蟲的手機天氣預報系統(tǒng)今日科苑 2021 年第 2 期 []鄭力明易平 Design of Crawler Based on HTML Parser Information Extraction[J] 微計算機 信息 Microputer Information09June2021 [8]楊頌 歐陽柳波 基于 Heritrix 的面向電子商務網(wǎng)站增量爬蟲研究 軟件導刊 2021 年 7 月 [9]Heritrix 官方網(wǎng)站 [EBOL] cra [10]邱哲符滔滔開發(fā)自己的搜索引擎 Lucene 20Heritrix 人民郵電出版社 [11]羅剛 自己動手寫網(wǎng)絡爬蟲 清華大學出版社 2021101 [12]李盛韜 余智華 程學旗 Web 信息采集研究進展 [J] 計算機科學 2021 [13]S Chakrabarti M van den Berg and B Dom Focused Crawling A New Approach to TopicSpecific Web Resource Discovery [C] In Proceedings of the 8th International World Wide Web Conference Toronto Canada 1999 [14]曾偉輝李淼 深層網(wǎng)絡爬蟲研究綜述 [J] 計算機系統(tǒng)應用 2021 WSCE A Crawler Engine for LargeScale Discovery of Web Services Eyhab AlMasri and Qusay H Mahmoud Abstract This paper addresses issues relating to the efficient access and discovery of Web services across multiple UDDI Business Registries UBRs The ability to explore Web services across multiple UBRs is being a challenge particularly as size and magnitude of these registries increase As Web services proliferate finding an appropriate Web service across one or more service registries using existing registry APIs ie UDDI APIs raises a number of concerns such as performance efficiency endtoend reliability and most importantly quality of returned results Clients do not have to endlessly search accessible UBRs for finding appropriate Web services particularly when operating via mobile devices Finding relevant Webservices should be time effective and highly productive In an attempt to enhance the efficiency of searching for businesses and Web services across multiple UBRs we propose a novel exploration engine the Web Service Crawler Engine WSCE WSCE is capable of crawling multiple UBRs and enables for the establishment of a centralized Web services 抮 epository which can be used for largescale discovery of Web services The paper presents experimental validation results and analysis of the presented ideas 1 Introduction The co ntinuous growth and propagation of the inter have been some of the main factors for information overload which at many instances act as deterrents for quick and easy discovery of information Web services are interbased modular applications and the automatic discovery and position of Web services are an emerging technology of choice for building understandable applications used for businesstobusiness integration and are of an immense interest to governments businesses as well as individuals As Web services proliferate the same dilemma