Google Map を使って住所を正規化する

現在使っている地図ソフトの住所正規化機能の精度が低いので、Google Map を使って正規化できないか調べてます。Google Map API を使わない方向で検索してたら、以下の記事が見つかったので参考にさせて頂きました。
参考記事C#でHTMLの特定要素を取得する


VB で実装するとこんな感じになりますね。

Option Explicit On
Option Strict On

Imports System.Windows.Forms

Module Module1
    Class MyContext
        Inherits ApplicationContext

        Private _browser As WebBrowser

        Public Sub New(address As String)

            _browser = New WebBrowser()
            AddHandler _browser.DocumentCompleted,
                Sub(sender, e)
                    Dim doc = _browser.Document
                    Dim link = doc.GetElementById("link_A_1")
                    If (link IsNot Nothing) Then
                        Dim spans = link.GetElementsByTagName("span")
                        If (spans.Count <> 0) Then
                            Console.WriteLine(spans(0).InnerText)
                        End If
                    End If
                    Me.ExitThread()
                End Sub

            _browser.Navigate("http://maps.google.co.jp/maps?hl=ja&q=" + address)
        End Sub

    End Class

    Sub Main()
        Dim address = Console.ReadLine()
        Using context = New MyContext(address)
            Application.Run(context)
        End Using
        Console.ReadLine()
    End Sub
End Module

フレームをロードするたび DocumentCompleted イベントが発生するのは仕方ないですかね。もう少し調べてみようと思います。