[vba] 443포트로 접속하는 https://coinmarketcap.com 데이터 크롤링 > vb6.0/vba

본문 바로가기

vb6.0/vba

[vb6.0/vba] [vba] 443포트로 접속하는 https://coinmarketcap.com 데이터 크롤링

회원사진
하나를하더라도최선을
2019-10-29 01:26 5,925 0

본문



"https://coinmarketcap.com/exchanges/indodax/"의 데이터를 크롤링 하고자 합니다.


941ac106af31442a492519c8c1b367dc_1572279900_9959.png

 


잘 가지고 옵니다.


941ac106af31442a492519c8c1b367dc_1572279493_0476.png
 

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


댓글목록0

등록된 댓글이 없습니다.
게시판 전체검색