Option Explicit
Dim oHttp As Object
Public Function GetHtmlsource(strURL As String)
If oHttp Is Nothing Then
Set oHttp = CreateObject("MSXML2.XMLHTTP")
End If
oHttp.Open "GET", strURL, False
oHttp.setRequestHeader "If-Modified-Since", "Thu, 01 Jun 1970 00:00:00 GMT"
oHttp.Send
GetHtmlsource = oHttp.responseText
If (oHttp.Status < 200 Or oHttp.Status >= 300) Then
MsgBox "URL読み込みに失敗しました", vbExclamation + vbOKOnly, "Error!"
GetHtmlsource = ""
End If
End Function
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme