WebDriver' object has no attribute 'switch_to_context'
来源:1-18 原生app和H5进行相互切换代码实战

慕哥7148156
2018-10-20
原生APP切换至H5页面
def get_web_view():
sleep(10)
webview = driver.contexts
print(webview)
for view in webview:
if view == 'WEBVIEW_cn.com.open.mooc':
# driver.switch_to()
driver.switch_to_context(view)
break
driver.find_element_by_link_text('JAVA').click()
写回答
1回答
-
慕哥7148156
提问者
2018-10-20
写错了,不应该是driver.switch_to_context,应该是driver.switch_to.context
012018-10-20
相似问题