|
@@ -15,28 +15,28 @@ from common.feishu import Feishu
|
|
|
class Searchkey:
|
|
|
@classmethod
|
|
|
def start_wechat(cls, log_type, crawler):
|
|
|
- try:
|
|
|
- Common.logger(log_type, crawler).info('启动"微信"')
|
|
|
- # print('启动"微信"')
|
|
|
- desired_caps = {'app': r"C:\Program Files (x86)\Tencent\WeChat\WeChat.exe"}
|
|
|
- driver = webdriver.Remote(
|
|
|
- command_executor='http://127.0.0.1:4723',
|
|
|
- desired_capabilities=desired_caps)
|
|
|
- driver.implicitly_wait(10)
|
|
|
+ # try:
|
|
|
+ Common.logger(log_type, crawler).info('启动"微信"')
|
|
|
+ # print('启动"微信"')
|
|
|
+ desired_caps = {'app': r"C:\Program Files (x86)\Tencent\WeChat\WeChat.exe"}
|
|
|
+ driver = webdriver.Remote(
|
|
|
+ command_executor='http://127.0.0.1:4723',
|
|
|
+ desired_capabilities=desired_caps)
|
|
|
+ driver.implicitly_wait(10)
|
|
|
|
|
|
- # Common.logger(log_type).info('点击"聊天窗口"')
|
|
|
- # driver.find_element(By.NAME, '聊天').click()
|
|
|
- #
|
|
|
- # Common.logger(log_type).info('点击"爬虫群"')
|
|
|
- # driver.find_elements(By.NAME, '爬虫群')[0].click()
|
|
|
+ # Common.logger(log_type).info('点击"聊天窗口"')
|
|
|
+ # driver.find_element(By.NAME, '聊天').click()
|
|
|
+ #
|
|
|
+ # Common.logger(log_type).info('点击"爬虫群"')
|
|
|
+ # driver.find_elements(By.NAME, '爬虫群')[0].click()
|
|
|
|
|
|
- Common.logger(log_type, crawler).info('点击微信指数')
|
|
|
- driver.find_elements(By.NAME, '消息')[-1].click()
|
|
|
- Common.logger(log_type, crawler).info('休眠 3 秒,退出微信')
|
|
|
- time.sleep(3)
|
|
|
- driver.quit()
|
|
|
- except Exception as e:
|
|
|
- Common.logger(log_type, crawler).error(f'start_wechat异常:{e}\n')
|
|
|
+ Common.logger(log_type, crawler).info('点击微信指数')
|
|
|
+ driver.find_elements(By.NAME, '消息')[-1].click()
|
|
|
+ Common.logger(log_type, crawler).info('休眠 3 秒,退出微信')
|
|
|
+ time.sleep(3)
|
|
|
+ driver.quit()
|
|
|
+ # except Exception as e:
|
|
|
+ # Common.logger(log_type, crawler).error(f'start_wechat异常:{e}\n')
|
|
|
|
|
|
@classmethod
|
|
|
def get_search_key(cls, log_type, crawler):
|