You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.0 KiB
43 lines
1.0 KiB
from util import *
|
|
|
|
@timing_decorator
|
|
def main_qzgy() -> None:
|
|
"""简单方法爬取青藏高原数据"""
|
|
print("\n开始爬取数据1……")
|
|
qzgy = Crawler()
|
|
content = qzgy.crawler_1()
|
|
word_freqs = qzgy.get_freqs(content)
|
|
qzgy.print_freqs(word_freqs)
|
|
print("数据1词频获取结束。")
|
|
|
|
|
|
|
|
@timing_decorator
|
|
def main_lzwz() -> None:
|
|
"""简单方法爬取泸州问政获取词频"""
|
|
print("\n开始爬取数据2……")
|
|
lzwz = Crawler()
|
|
content = lzwz.get_data_2()
|
|
word_freqs = lzwz.get_freqs(content)
|
|
lzwz.print_freqs(word_freqs)
|
|
print("数据2词频获取结束。")
|
|
|
|
|
|
|
|
@timing_decorator
|
|
def main_gdb() -> None:
|
|
"""简单方法爬取古德堡计划数据"""
|
|
print("\n开始爬取数据3……")
|
|
gdb = Crawler()
|
|
content = gdb.get_data_3()
|
|
word_freqs = gdb.get_freqs_of_En(content)
|
|
gdb.print_freqs(word_freqs)
|
|
print("数据3词频获取结束。")
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main_qzgy()
|
|
main_lzwz()
|
|
main_gdb()
|