初心者です。IEは出てくるのですが、MsgBoxが出てきません。
何故出てこないかをわかりやすく教えてください。よろしくお願いします。
最終的な目標はarticleタグ内の住所や会社名などを一つ一つexcelに取得することです。
lang
1Sub ie_test() 2 Dim ie As InternetExplorer 3 Dim doc As HTMLDocument 4 Dim i As Long 5 6 Set ie = CreateObject("InternetExplorer.Application") 7 ie.Visible = True 8 ie.Navigate "http://itp.ne.jp/genre_dir/restaurant/?sr=1&ngr=1&evdc=1&st=4" 9 Do While ie.Busy Or ie.ReadyState < READYSTATE_COMPLETE 10 DoEvents 11 Loop 12 13 Set doc = ie.Document 14 15 16 For i = 0 To doc.all.Length - 1 17 If doc.all(i).tagName = "article" Then 18 If doc.all(i).innerText = "群馬県桐生市相生町" Then 19 MsgBox doc.innerText 20 21 Exit For 22 End If 23 End If 24 Next i 25 26End Sub 27
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/03/30 11:09