如果 html id 是,可以说“ex_a1”、“ex_a2”、“ex_a3”等。你可以只使用第 5 个字母作为参考吗?
也许像这样?
`Dim 元素 = WebBrowser1.Document.GetElementsByTagName("a")
For Each element As HtmlElement In elements
If element.GetAttribute("className") = "EXAMPLE" Then
If 5TH_LETTER_OF_ID = UserChoice then
element.InvokeMember("click")
Exit For
End If
End If
Next`
UserChoice 是 0 到 16 之间的数字