wangkun 1 year ago
parent
commit
2ebdbf14dc
1 changed files with 4 additions and 4 deletions
  1. 4 4
      shipinhao/shipinhao_search/shipinhao_search.py

+ 4 - 4
shipinhao/shipinhao_search/shipinhao_search.py

@@ -186,9 +186,9 @@ class ShipinhaoSearch:
             "automationName": "UiAutomator2",  # 使用引擎,默认为 Appium,
             # 其中 Appium、UiAutomator2、Selendroid、Espresso 用于 Android,XCUITest 用于 iOS
             "showChromedriverLog": True,
-            # "chromeOptions": {"androidProcess": "com.tencent.mm:appbrand0"},
+            "chromeOptions": {"androidProcess": "com.tencent.mm:appbrand0"},
             # "chromeOptions": {"androidProcess": "com.tencent.mm:tools"},
-            "chromeOptions": {"androidProcess": "com.tencent.mm"},
+            # "chromeOptions": {"androidProcess": "com.tencent.mm"},
             'enableWebviewDetailsCollection': True,
             'setWebContentsDebuggingEnabled': True,
             'chromedriverExecutable': chromedriverExecutable,
@@ -244,8 +244,8 @@ class ShipinhaoSearch:
         webviews = driver.contexts
         Common.logger(log_type, crawler).info(f"webviews:{webviews}")
         # for webview in webviews:
-        # driver.switch_to.context(webviews[1])
-        driver.switch_to.context('WEBVIEW_com.tencent.mm:tools')
+        driver.switch_to.context(webviews[1])
+        # driver.switch_to.context('WEBVIEW_com.tencent.mm:tools')
         time.sleep(1)
         windowHandles = driver.window_handles
         for handle in windowHandles: