| 
														
															@@ -4,23 +4,30 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 from appium import webdriver 
														 | 
														
														 | 
														
															 from appium import webdriver 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 from selenium.webdriver.common.by import By 
														 | 
														
														 | 
														
															 from selenium.webdriver.common.by import By 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+from main.common import Common 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 class Click: 
														 | 
														
														 | 
														
															 class Click: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @classmethod 
														 | 
														
														 | 
														
															     @classmethod 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    def click_video(cls): 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    def click_video(cls, log_type): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Common.logger(log_type).info('启动"微信"') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         desired_caps = {'app': r"C:\Program Files (x86)\Tencent\WeChat\WeChat.exe"} 
														 | 
														
														 | 
														
															         desired_caps = {'app': r"C:\Program Files (x86)\Tencent\WeChat\WeChat.exe"} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         driver = webdriver.Remote( 
														 | 
														
														 | 
														
															         driver = webdriver.Remote( 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             command_executor='http://127.0.0.1:4723', 
														 | 
														
														 | 
														
															             command_executor='http://127.0.0.1:4723', 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             desired_capabilities=desired_caps) 
														 | 
														
														 | 
														
															             desired_capabilities=desired_caps) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         driver.implicitly_wait(10) 
														 | 
														
														 | 
														
															         driver.implicitly_wait(10) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Common.logger(log_type).info('点击"爬虫群"') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         driver.find_element(By.NAME, '爬虫群').click() 
														 | 
														
														 | 
														
															         driver.find_element(By.NAME, '爬虫群').click() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         msg_list = driver.find_elements(By.NAME, '消息') 
														 | 
														
														 | 
														
															         msg_list = driver.find_elements(By.NAME, '消息') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Common.logger(log_type).info('点击最新一条"消息"') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         msg = msg_list[-1] 
														 | 
														
														 | 
														
															         msg = msg_list[-1] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        title = msg.get_attribute('name') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        print(title) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         msg.click() 
														 | 
														
														 | 
														
															         msg.click() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        title = msg.get_attribute('name') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Common.logger(log_type).info('title:{}', title) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 if __name__ == '__main__': 
														 | 
														
														 | 
														
															 if __name__ == '__main__': 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    Click.click_video() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    Click.click_video('recommend') 
														 |