如何覆盖证书错误消息,并点击链接"使用Excel宏继续访问此网站(不推荐)。" 。
请找到我创建的代码,
Sub Cert_error()
Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
On Error GoTo Err_Clear
MyURL = "https://cacert.org/" 'or you can use "https://www.pcwebshop.co.uk/"
Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.navigate MyURL
MyBrowser.navigate MyURL
MyBrowser.Visible = True
For Each MyHTML_Element In HTMLDoc.getElementsByTagName("img")
If MyHTML_Element.ID = "overridelink" Then MyHTML_Element.Click: Exit For
Next
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
End Sub
请找到下面的HTML标记
<tr>
<td> </td>
<td align="left" id="continueToSiteAlign" aria-labelledby="continueToSite" valign="middle">
<h4 id="continueToSite">
<img class="actionIcon" id="ImgOverride" alt="Not recommended icon" src="red_shield.png" border="0"><a name="overridelink" id="overridelink" href="https://cacert.org/">Continue to this website (not recommended).</a>
</h4>
</td>
</tr>
如果我们可以点击该链接并使用excel宏进入网站,请告诉我。
提前致谢。