掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ログイン後のHTMLを取得するには? (ID:109710)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
初心者のくせに無謀な質問をしますが、どうかお助けください。 まず、私がしたい事は 1.自動でユーザーID、パスワードを入力し、ログイン 2.ログイン後に表示される画面より必要な情報を(変数sitetxtに代入)取り出す なのですが時々情報を取り出す事が出来ない事があります。 変数sitetxtがnullのまま終わることがあるのです。 以下にソースを書きます。 Private Sub sample1() Dim url As String Dim IE As Object Set IE = CreateObject("InternetExplorer.Application") Dim userid As String, passwd As String,sitetxt as String userid="userid" passwd="passwd" url="http://****" With IE .Navigate (url) DoEvents Do While .Busy = True DoEvents Loop .Visible = True Do While .document.ReadyState <> "complete" DoEvents Loop .document.Forms(0).Elements("userID").Value = CVar(userid) .document.Forms(0).Elements("password").Value = CVar(passwd) .document.Forms(0).Elements("password2").Value = CVar(passwd) .document.Forms(0).Elements("submit").Click Do While .Busy = True DoEvents Loop .Visible = True Do While .document.ReadyState <> "complete" DoEvents Loop sitetxt = .document.body.innertext End With Loop Set IE = Nothing End Sub 素人丸出しのソースで恥ずかしいのですがどこが悪いのかお教え願えませんか?
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.