vba [vba] MSXML2.XMLHTTP.6.0 을 이용한 https://kr.investing.com/ 사이트의 443 포트 크…
페이지 정보
본문
https://kr.investing.com/equities/south-korea/ 사이트의 443 포트 접속 파싱하기
Sub program1472_com()
Dim T As String, URL As String
With CreateObject("MSXML2.XMLHTTP.6.0")
.Open "GET", URL
.SetRequestHeader "Host", "kr.investing.com"
.SetRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0"
.SetRequestHeader "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
.SetRequestHeader "Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3"
.SetRequestHeader "Connection", "keep-alive"
.SetRequestHeader "Upgrade-Insecure-Requests", "1"
.Send
T = .ResponseText
End With
T = Split(Split(T, "<table")(1), "</table")(0)
T = "<table" & T & "</table>"
SetClipboard T
ActiveSheet.Paste Destination:=[A1]
End Sub
'// 클립보드에 텍스트 쓰기
Public Function SetClipboard(ByRef sText As String) As Boolean ' ### 리턴값: 성공 여부
On Error GoTo nErr
Dim Clipboard As Object
' Microsoft Forms 2.0 Object Library
Set Clipboard = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
Clipboard.SetText sText
Clipboard.PutInClipboard
SetClipboard = True
nErr:
End Function
- 이전글[vb6.0/vba] WinHttp.WinHttpRequest.5.1 example with error handling 19.09.28
- 다음글[vb6.0/vba] WinHttp 쿠키값 유지 및 갱신 19.09.28
댓글목록
등록된 댓글이 없습니다.