()
| 28 | spider.start() # 采集 |
| 29 | |
| 30 | def test_debug(): |
| 31 | spider = test_spider.TestSpider.to_DebugBatchSpider( |
| 32 | task_id=1, |
| 33 | redis_key="feapder:test_batch_spider", # 分布式爬虫调度信息存储位置 |
| 34 | task_table="batch_spider_task", # mysql中的任务表 |
| 35 | task_keys=["id", "url"], # 需要获取任务表里的字段名,可添加多个 |
| 36 | task_state="state", # mysql中任务状态字段 |
| 37 | batch_record_table="batch_spider_batch_record", # mysql中的批次记录表 |
| 38 | batch_name="批次爬虫测试(周全)", # 批次名字 |
| 39 | batch_interval=7, # 批次周期 天为单位 若为小时 可写 1 / 24 |
| 40 | ) |
| 41 | |
| 42 | |
| 43 | spider.start() # 采集 |
| 44 | |
| 45 | |
| 46 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected