VB.NETを使用して投票マクロを作成しています。ボタンのクリックを除いて、すべて正常に動作しています。
ボタンのコード:
<input type="button" value="Vote: Runelocus" onclick="window.open('http://www.runelocus.com/toplist/index.php?action=vote&id=277&id2=333119125058'); setStatus(1);">
このボタンをクリックするたびに、リンクを取得する代わりに、system._comobject
.
これは、アドレスを取得するために使用しているコードです
Try
Dim ele As HtmlElement = WebBrowser1.Document.ActiveElement
Dim target As String = ele.GetAttribute("onclick")
target = target.Replace("'); setStatus(1);", String.Empty)
target = target.Replace("window.open('", String.Empty)
e.Cancel = True
Dim window As New Voter()
window.Show()
window.WebBrowser1.Navigate(target)
status.Items.Add(target)
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try