CN112925966A - 一种新型暗网挖掘机器人的设计方法 - Google Patents

一种新型暗网挖掘机器人的设计方法 Download PDF

Info

Publication number
CN112925966A
CN112925966A CN201911237183.8A CN201911237183A CN112925966A CN 112925966 A CN112925966 A CN 112925966A CN 201911237183 A CN201911237183 A CN 201911237183A CN 112925966 A CN112925966 A CN 112925966A
Authority
CN
China
Prior art keywords
url
webdriver
page
webpage
soup
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911237183.8A
Other languages
English (en)
Inventor
刘挺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Tingge Network Technology Co ltd
Original Assignee
Tianjin Tingge Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Tingge Network Technology Co ltd filed Critical Tianjin Tingge Network Technology Co ltd
Priority to CN201911237183.8A priority Critical patent/CN112925966A/zh
Publication of CN112925966A publication Critical patent/CN112925966A/zh
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提出了一种针对暗网中指定的网站或者论坛进行深度挖掘的方法。该方法使用暗网爬虫工具,针对指定的网站进行深度挖掘,按照关键词进行关联分析,一旦找到包含该关键词的网页,将其保存下来,并且存入结果文件中,结果文件是网页链接,里面包含找到的相关网页的网址链接。

Description

一种新型暗网挖掘机器人的设计方法
技术领域
该项技术主要是从事暗网数据挖掘行业所需要采取的技术,该技术包含网络编程,爬虫,数据分析等多领域技术,是一项综合性的互联网技术。
背景技术
该技术包含网络爬虫,关键词分析,结果写入。
发明内容
该项***目前运行在ubuntu***之上,该项技术主要包含以下两个部分:配置文件和软件库。
配置文件主要是用来存储该***运行的必要参数的,主要是xml文件。软件库主要是由不同的软件函数来构成的,这些软件函数是构成大软件运行的基础。
该工具包含2个配置文件,config_main.xml, config_auto_digger.xml。
该工具分为启动,关键词分析,写入三个阶段。
启动阶段是该软件从控制软件开始启动抓取工具,先将config_main.xml进行beautifulsoup实例化,生成config_soup_vertical,同时将config_auto_digger.xml进行beautifulsoup实例化,生成config_main_soup_vertical。软件先从config_client.xml中读取参数,根据读取的webdriver_type,来决定启动的工具,如果webdriver_type是chrome,则采用driver_local = webdriver.chrome(path_to_chrom_driver),如果webdriver_type是firefox_binary,则采用driver_local = FirefoxBinary(binary_path),其中binary_path是firefox的binary的地址,如果webdriver_type是ie,则采用driver_local = webdriver.Ie(webdriver_path),webdriver_path是ie的binary的存放地址,如果webdriver_type是chrome_binary,则采用driver_local = webdriver.Chrome(chrome_options=options, executable_path=path_to_chrom_driver)的方式,其中chrome_options是chrome的option设置信息,path_to_chrom_driver是chrome_driver的binary的存放地址。如果webdriver_type是phantomjs,则采用driver_local =webdriver.PhantomJS(execute_path=binary_location),其中binary_location是phantomjs的存放地址,如果webdriver_type是onion,则采用driver_local =TorBrowserDriver(tbb_dir),其中tbb_dir是torbrowser的binary的存放地址,如果webdriver_type是onion_headless,则采用driver_local = TorBrowserDriver(tbb_dir),其中tbb_dir是torbrowser的binary的存放地址。
启动之后,采用driver_local.get(url)的方法,对启动的部件输入url,获取相关的页面的信息,使用page_source = driver_local.page_source的方式获取page_source信息,然后将其分解,parse_soup = Beautifulsoup(page_source, parser), 其中parser是不同的解析器类型,包含但不限于,lxml , html.parser等。然后根据配置文件对该网页信息进行数据抽取,抽取出其中的client的信息,并且以dictionary的形式存储起来。
启动一个dictionary,称之为mega_dictionary,mega_dictionary包含2个子类dictionary,分别是url_dict, parsed_url_dict,其中url_dict是专门存储url的dictionary,其初始状态是空的,parsed_url_dict是专门存储分析过的url,其初始状态是空的。
将config_auto.xml使用beautifulsoup变成一个beautifulsoup的实例,称之为config_soup,将config_digger.xml使用beautifulsoup变成一个beautifulsoup的实例,称之为keyword_soup,从config_soup中获取webdriver的配置信息,根据获取的config_soup的配置信息,来启动一个抓取模块,该抓取模块跟上述启动阶段中启动抓取工具是一样的方法,但是从config_soup中读取的webdriver_node的信息中包含webdriver_name的信息,如果webdriver_name的信息是onion_headless,则启动xvfb_display, 即xvfb_display = start_xvfb(),该启动模块会启动两个抓取模块,分别是driver_local和driver_local_page。
从 keyword_soup中读取挖掘的深度,根据挖掘的深度,进行一次循环,在每个循环中,对mega_dict进行更新,对其使用Get_Url_Dict_Vertical_With_Write函数。在每层digger_level的循环中,将url_dict读取出来,对其中的每个url,即url_dict.keys(),将url输入Get_Url_Dict_Vertical_With_Write函数中。
Get_Url_Dict_Vertical_With_Write函数是对mega_dict不断进行更新和升级,其中包含url,config_soup, keyword_soup, mega_dict和driver_local。开始时,先从mega_dict中取出url_dict和parsed_url_dict。然后将输入的url给driver_local, 使用driver_local.get(url)的方法来获取信息,将该url存入parsed_url_dict,然后获取该页面信息,并且使用Beautifulsoup实例化,将其称为parse_soup,在parse_soup中使用find_all(‘a’, href=True)的方法获取全部href,对获得的所有href进行遍历,使用final_value来装取href的链接,然后使用driver_local.get(final_value)的方式获取页面,将页面信息Beautifulsoup实例化,并且称之为parse_soup。将已经分析过的final_value存入parsed_url_dict。同时对parse_soup使用Check_Contains_Keywords的方法判断该链接是否包含关键词,如果包含关键词,则使用Write_Into_Result_File_By_Page_Vertical的方法将其写入结果页面文档。
现在对Check_Contains_Keywords的方法进行进一步的解说,该阶段是关键词分析的阶段,Check_Contains_Keywords主要输入是parse_soup,config_soup。先从Config_soup中去除keyword,然后对所有的keyword进行遍历,先将parse_soup进行清洗,然后使用keyword in parse_soup的方法判断keyword是否处于parse_soup之中。如果有一个keyword处于其中,则判断parse_soup包含该keyword,返回值是True,否则是False。
对Write_Into_Result_File_By_Page_Vertical进行一部分解说,该阶段是写入的阶段,该方法主要输入是config_soup, config_main_soup和url_dict。先从config_main_soup中获取存储地址,如果存储地址文件夹不存在则使用os.makedirs的方法创造该文件夹,存储地址为save_path。其次从config_soup中获取每页显示的条数,number_per_result_file。计算url_dict中的url的个数,通过四舍五入的方法计算输出结果页面的总文件个数,得到number_of_result_files,即结果文件的个数。对number_of_results_files进行遍历,先使用save_path+”/result”+str(i)+”.html”的方法获得每次需要存储的结果文件地址,打开该结果文件,写入原始头文件,该头文件如下,<html><head><metacharset=’utf-8’/></head><title>结果</title><body><table></table></body></html>,使用Beautifulsoup将其实例化,称之为html_soup,对于每个结果文件i,对url_dict做一次遍历,当url_dict中的url属于该结果文件的区间的时候,将该url_dict的内容写入,写入的方法是,使用html_soup生成一个a的tag,它的string是url的标题,target是blank,然后生成一个td的tag,再生成一个tr的tag,将a的tag包入td之中,将td包入tr之中,再将tr包入html_soup的table之中,于是写入,每个结果文件的起始区间分别是begin_index是counter_parse_url和i*number_per_result_file之和,end_index是begin_index加上一个number_per_result_file。

Claims (5)

1.要求对该***的启动的各种方法及其衍生方法进行保护。
2.要求对该***的配置的运行环境及其衍生方法进行保护,即运行在ubuntu***之上的暗网数据挖掘机器人***。
3.要求对该***的分析部分及其衍生方法进行保护。
4.要求对该***的写入部分及其衍生方法进行保护。
5.要求对该***的整体及其衍生方法进行保护。
CN201911237183.8A 2019-12-05 2019-12-05 一种新型暗网挖掘机器人的设计方法 Pending CN112925966A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911237183.8A CN112925966A (zh) 2019-12-05 2019-12-05 一种新型暗网挖掘机器人的设计方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911237183.8A CN112925966A (zh) 2019-12-05 2019-12-05 一种新型暗网挖掘机器人的设计方法

Publications (1)

Publication Number Publication Date
CN112925966A true CN112925966A (zh) 2021-06-08

Family

ID=76162233

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911237183.8A Pending CN112925966A (zh) 2019-12-05 2019-12-05 一种新型暗网挖掘机器人的设计方法

Country Status (1)

Country Link
CN (1) CN112925966A (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040139171A1 (en) * 2002-11-25 2004-07-15 Chen Richard C. Browser capable of regular expression-triggered advanced download of documents hyperlinked to current page
CN103546326A (zh) * 2013-11-04 2014-01-29 北京中搜网络技术股份有限公司 一种网站流量统计的方法
CN106445950A (zh) * 2015-08-10 2017-02-22 刘挺 个性化分布式数据挖掘***
CN107808000A (zh) * 2017-11-13 2018-03-16 哈尔滨工业大学(威海) 一种暗网数据采集与抽取***及方法
CN108984568A (zh) * 2017-06-04 2018-12-11 北京询达数据科技有限公司 一种全自动互联网暗网搜索引擎的设计方法
CN110309118A (zh) * 2018-03-06 2019-10-08 北京询达数据科技有限公司 一种深度网络数据挖掘机器人的设计方法
CN110309467A (zh) * 2018-03-25 2019-10-08 北京询达数据科技有限公司 一种全自动深度网络挖掘机的设计方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040139171A1 (en) * 2002-11-25 2004-07-15 Chen Richard C. Browser capable of regular expression-triggered advanced download of documents hyperlinked to current page
CN103546326A (zh) * 2013-11-04 2014-01-29 北京中搜网络技术股份有限公司 一种网站流量统计的方法
CN106445950A (zh) * 2015-08-10 2017-02-22 刘挺 个性化分布式数据挖掘***
CN108984568A (zh) * 2017-06-04 2018-12-11 北京询达数据科技有限公司 一种全自动互联网暗网搜索引擎的设计方法
CN107808000A (zh) * 2017-11-13 2018-03-16 哈尔滨工业大学(威海) 一种暗网数据采集与抽取***及方法
CN110309118A (zh) * 2018-03-06 2019-10-08 北京询达数据科技有限公司 一种深度网络数据挖掘机器人的设计方法
CN110309467A (zh) * 2018-03-25 2019-10-08 北京询达数据科技有限公司 一种全自动深度网络挖掘机的设计方法

Similar Documents

Publication Publication Date Title
Mu et al. An algebraic approach to bi-directional updating
JP3879350B2 (ja) 構造化文書処理システム及び構造化文書処理方法
US11662984B2 (en) Frequent source code pattern mining
EP2895951A1 (en) Capturing activity history stream
Hajba Website Scraping with Python
Janjic et al. An unabridged source code dataset for research in software reuse
Benjamin et al. Some modeling challenges when testing rich internet applications for security
Miraldo et al. An efficient algorithm for type-safe structural diffing
CN110309467A (zh) 一种全自动深度网络挖掘机的设计方法
Liu et al. An XML-enabled data extraction toolkit for web sources
Wessman et al. A generalized framework for an ontology-based data-extraction system
CN112925966A (zh) 一种新型暗网挖掘机器人的设计方法
CN112925970A (zh) 一种新型暗网全网挖掘机器人的设计方法
Beckmann et al. Partial Parsing for Structured Editors
Sudarsan et al. Metamodel search: Using XPath to search domain-specific models
Miller Text Processing with Ruby: Extract Value from the Data that Surrounds You
Hong et al. Concurrent programming on the web with webstream
CN113392298A (zh) 一种基于xml数据库的定点暗网情报挖掘分析***的设计方法
Cacciari Miraldo et al. An Efficient Algorithm for Type-Safe Structural Diffing
Lo et al. Automatic template detection for structured Web pages
Gomathi et al. Web Access Pattern Algorithms in Education Domain.
Charoenwet A Digital Collection Study and Framework Exploration–Applying Textual Analysis on Source Code Collection
Addagada Indexing and searching document collections using Lucene
Carnell et al. Creating a Search Engine with Lucene
Ramalho et al. Document Semantics: two approaches

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210608

RJ01 Rejection of invention patent application after publication