'commit'
This commit is contained in:
@@ -1,24 +1,23 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import uuid
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import time
|
||||
import uuid
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
from datetime import datetime
|
||||
from Apps.YeLiTe.Kit import take_screenshot, clean_station_name, get_image_content_md5, detect_price_info_container_cv
|
||||
from Apps.YeLiTe.ReadImageKit import ReadImageKit
|
||||
from Apps.YeLiTe.Service import YeLiTeService
|
||||
from Apps.YeLiTe.Config.Setting import (
|
||||
SCROLL_DISTANCE_RATIO, WAIT_AFTER_SCROLL, MAX_STATIONS_COUNT,
|
||||
WAIT_DETAIL_PAGE_LOAD, WAIT_BACK_TO_LIST, TEST_CLEAR_REDIS,
|
||||
SAFE_EXCLUDE_RATIO, BOTTOM_SAFE_EXCLUDE_RATIO,
|
||||
FIRST_RUN_ONLY_ONE_STATION
|
||||
)
|
||||
from Apps.YeLiTe.Kit import take_screenshot, clean_station_name, get_image_content_md5, detect_price_info_container_cv, \
|
||||
get_image_md5
|
||||
from Apps.YeLiTe.ReadImageKit import ReadImageKit
|
||||
from Apps.YeLiTe.Service import YeLiTeService
|
||||
from Core.BaseCrawler import BaseCrawler
|
||||
from Util.RedisKit import RedisKit
|
||||
from Core.BaseCrawler import BaseCrawler
|
||||
import uiautomator2 as u2
|
||||
|
||||
# 项目根目录处理
|
||||
project_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
@@ -28,7 +27,7 @@ if project_root not in sys.path:
|
||||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
logger = logging.getLogger("YeLiTeCrawler")
|
||||
|
||||
class YiLaiTeCrawler(BaseCrawler):
|
||||
class YeLiTeCrawler(BaseCrawler):
|
||||
def __init__(self, service=None):
|
||||
super().__init__(service or YeLiTeService())
|
||||
self.read_image_kit = ReadImageKit()
|
||||
@@ -345,7 +344,7 @@ async def main(service=None):
|
||||
service = YeLiTeService()
|
||||
await service.init_db()
|
||||
|
||||
crawler = YiLaiTeCrawler(service)
|
||||
crawler = YeLiTeCrawler(service)
|
||||
d = u2.connect()
|
||||
|
||||
# 清理 Redis
|
||||
@@ -368,7 +367,7 @@ async def main(service=None):
|
||||
finally:
|
||||
await service.log_task_end(task_id, total_count, status, error_msg)
|
||||
# 如果是内部初始化的 service,则关闭
|
||||
if service and not isinstance(service, YeLiTeService):
|
||||
if service and not isinstance(service, YiLaiTeService):
|
||||
await service.close_db()
|
||||
|
||||
async def get_image_md5_async(path):
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user