vb6.0/vba [vba] 443포트로 접속하는 https://coinmarketcap.com 데이터 크롤링
페이지 정보
본문
"https://coinmarketcap.com/exchanges/indodax/"의 데이터를 크롤링 하고자 합니다.
잘 가지고 옵니다.
Sub program1472_com()
Dim URL As String, Cookie As String
Dim T As String
With CreateObject("MSXML2.XMLHTTP.6.0")
.Open "GET", URL
.SetRequestHeader "Host", "coinmarketcap.com"
.SetRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.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"
If Len(Cookie) Then .SetRequestHeader "Cookie", Cookie
.SetRequestHeader "Upgrade-Insecure-Requests", "1"
.SetRequestHeader "Cache-Control", "max-age=0"
.SetRequestHeader "TE", "Trailers"
.Send
T = .ResponseText
End With
T = Split(Split(T, "<table")(3), "</table>")(0)
T = "<table" & T & "</table>"
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText T
.PutInClipboard
End With
ActiveSheet.Paste Destination:=[A1]
ActiveSheet.Shapes.SelectAll
Selection.Delete
End Sub
- 이전글[vb6.0/vba] HTML 테그를 한방에 정리(함수) 19.10.29
- 다음글[vba] 지정한 셀에 붙여넣기(Paste) 19.10.29
댓글목록
등록된 댓글이 없습니다.