あるサイト(https://search.npb.go.jp/kanpou/)の認証画面に自動的にID/PASSを入力して、自動的にログインするようなプログラムを作りたいのですが、ID/PASSの入力は問題無く行えるものの、ログインの際にエラー(予期しない操作により、処理中にエラーが発生しました。再度ログインを行ってください。)となります。何が悪いのでしょうか?
【ログイン部分のプログラム】
ieTarget = CreateObject("InternetExplorer.Application")
ieTarget.Visible = TrueValue = KANPOU_ID
.document.Forms(0).elements("password").Value = KANPOU_PASS
.document.forms(0).elements.submit()
ieTarget.navigate("https://search.npb.go.jp/kanpou/")
Do While (ieTarget.busy)
Loop
Do While (ieTarget.document.ReadyState <> "complete")
Loop
With ieTarget
.document.Forms(0).elements("uji.model.4.value_userId").Value =KANPOU_ID
.document.Forms(0).elements("password").Value = KANPOU_PASS
.document.forms(0).elements.submit()
End With
お礼
無事に自動ログインできました。 どうもありがとうございます。 本当に助かりました。