wangkun 1 jaar geleden
bovenliggende
commit
8e9be6aeec
1 gewijzigde bestanden met toevoegingen van 6 en 3 verwijderingen
  1. 6 3
      shipinhao/shipinhao_search/shipinhao_search.py

+ 6 - 3
shipinhao/shipinhao_search/shipinhao_search.py

@@ -549,13 +549,16 @@ class ShipinhaoSearch:
         driver.implicitly_wait(10)
         driver.implicitly_wait(10)
         Common.logger(log_type, crawler).info("点击搜索框")
         Common.logger(log_type, crawler).info("点击搜索框")
         Common.logging(log_type, crawler, env, "点击搜索框")
         Common.logging(log_type, crawler, env, "点击搜索框")
-        driver.find_element(By.ID, 'com.tencent.mm:id/j5t').click()
+        # driver.find_element(By.ID, 'com.tencent.mm:id/j5t').click()  # 微信8.0.30版本
+        driver.find_element(By.ID, 'com.tencent.mm:id/he6').click()  # 微信8.0.16版本
         time.sleep(0.5)
         time.sleep(0.5)
-        driver.find_element(By.ID, 'com.tencent.mm:id/cd7').clear().send_keys(word)
+        # driver.find_element(By.ID, 'com.tencent.mm:id/cd7').clear().send_keys(word)  # 微信8.0.30版本
+        driver.find_element(By.ID, 'com.tencent.mm:id/bxz').clear().send_keys(word)  # 微信8.0.16版本
         driver.press_keycode(AndroidKey.ENTER)
         driver.press_keycode(AndroidKey.ENTER)
         Common.logger(log_type, crawler).info("进入搜索词页面")
         Common.logger(log_type, crawler).info("进入搜索词页面")
         Common.logging(log_type, crawler, env, "进入搜索词页面")
         Common.logging(log_type, crawler, env, "进入搜索词页面")
-        driver.find_elements(By.ID, 'com.tencent.mm:id/br8')[0].click()
+        # driver.find_elements(By.ID, 'com.tencent.mm:id/br8')[0].click()  # 微信8.0.30版本
+        driver.find_elements(By.ID, 'com.tencent.mm:id/jkg')[0].click()  # 微信8.0.16版本
         time.sleep(5)
         time.sleep(5)
 
 
         # 切换到微信搜索结果页 webview
         # 切换到微信搜索结果页 webview