当前位置: 首页>>代码示例>>Python>>正文


Python Crawler.crawl_native方法代码示例

本文整理汇总了Python中Crawler.Crawler.crawl_native方法的典型用法代码示例。如果您正苦于以下问题:Python Crawler.crawl_native方法的具体用法?Python Crawler.crawl_native怎么用?Python Crawler.crawl_native使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Crawler.Crawler的用法示例。


在下文中一共展示了Crawler.crawl_native方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_crawl_native_fakeCrawler

# 需要导入模块: from Crawler import Crawler [as 别名]
# 或者: from Crawler.Crawler import crawl_native [as 别名]
 def test_crawl_native_fakeCrawler(self):
     parameter_file = "./test/search_parameters.json"
     c = Crawler("SimpleTest", parameters=FileOperations.get_from_JSON_file(parameter_file))
     self.assertEqual(c.name, "SimpleTest")
     c.crawl_native()
     self.assertTrue(os.path.isfile(parameter_file))
     result_from_file = FileOperations.get_from_JSON_file(c.output["path"])
     self.assertEqual(len(result_from_file), 3)
开发者ID:glebedel,项目名称:FileCrawler,代码行数:10,代码来源:test_crawler.py

示例2: test_crawl_clientIntegrations

# 需要导入模块: from Crawler import Crawler [as 别名]
# 或者: from Crawler.Crawler import crawl_native [as 别名]
 def test_crawl_clientIntegrations(self):
     parameter_data = FileOperations.get_from_JSON_file("./test/search_integration.json")
     crawlers = parameter_data["crawlers"]
     crawlerName = "Integration"
     c = Crawler(crawlerName, parameters=crawlers[crawlerName])
     data = c.crawl_native()
     self.assertTrue(len(data) > 0)
     c.save_crawler_data(data, crawlers[crawlerName]["output"])
开发者ID:glebedel,项目名称:FileCrawler,代码行数:10,代码来源:test_crawler.py

示例3: test_crawl_multithread_mmcoreAsync

# 需要导入模块: from Crawler import Crawler [as 别名]
# 或者: from Crawler.Crawler import crawl_native [as 别名]
 def test_crawl_multithread_mmcoreAsync(self):
     parameter_data = FileOperations.get_from_JSON_file("./test/search_async.json")
     crawlers = parameter_data["crawlers"]
     crawlerName = "dotAsync"
     c = Crawler(crawlerName, parameters=crawlers[crawlerName])
     data = c.crawl_native(threads=None)
     self.assertTrue(len(data) > 0)
     c.save_crawler_data(data, crawlers[crawlerName]["output"])
开发者ID:glebedel,项目名称:FileCrawler,代码行数:10,代码来源:test_crawler.py

示例4: test_crawl_native_minimalParameterFile_multithreaded

# 需要导入模块: from Crawler import Crawler [as 别名]
# 或者: from Crawler.Crawler import crawl_native [as 别名]
 def test_crawl_native_minimalParameterFile_multithreaded(self):
     c = Crawler("MyMinimalCrawler", FileOperations.get_from_JSON_file("./test/minimal_parameters.json"))
     self.assertEqual(c.crawl_native(threads=10)['./test/test_inputs/minimalist_data.txt']['matches']['HasName']['city'][0], 'London')
开发者ID:glebedel,项目名称:FileCrawler,代码行数:5,代码来源:test_crawler.py


注:本文中的Crawler.Crawler.crawl_native方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。