我正在为特定网站开发自动化环境..
然而,当我导航到URL时,我收到一条消息“你的连接不是私密的”..
我想知道如何使用硒自动管理?我的意思是,我怎么能通过代码知道消息出现以及如何导航到所需的URL?
感谢
答案 0 :(得分:0)
try
{
//..
}
catch(Exception ex)
{
if(ex.Message.Contains("Your connection is not private"))
{
// what you need to do...
}
}
答案 1 :(得分:0)
尝试
If(driver.PageSource.Contains("Your connection is not private"))
{
// your code
}