Results 1 to 5 of 5

Thread: extract data from web

  1. #1
    Acolyte aswathy0001's Avatar
    Join Date
    Nov 2016
    Location
    india
    Posts
    24
    Articles
    0
    Excel Version
    2010

    Post extract data from web



    Register for a FREE account, and/
    or Log in to avoid these ads!

    i want to extract data from https://www.visionwheel.com/dealers/dealer-search.cfm for each zip code
    i tried with zipcode 75211 but i doesnt get the full url
    tried with https://www.visionwheel.com/dealers/dealer-search.cfm?zipCode=75211 but can
    any one help?

  2. #2
    Acolyte aswathy0001's Avatar
    Join Date
    Nov 2016
    Location
    india
    Posts
    24
    Articles
    0
    Excel Version
    2010
    any help?

  3. #3
    Neophyte ArdusPetus's Avatar
    Join Date
    Mar 2020
    Posts
    2
    Articles
    0
    Excel Version
    2019
    The form is a POST form, not a GET one.
    Your request should be like this:
    Code:
        
    With oXMLH        
        .Open "POST", "https://www.visionwheel.com/dealers/dealer-search.cfm"
        .send "Zipcode: " & zip
    HTH,
    --
    AP

  4. #4
    Seeker ges's Avatar
    Join Date
    Jul 2019
    Location
    Italy
    Posts
    5
    Articles
    0
    Excel Version
    2016
    Hi, try this
    Code:
    #If VBA7 Then
    Public Declare PtrSafe Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As LongPtr)
    #Else
    Public Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
    #End If
    
    Sub WebDAta()
        Dim IE As InternetExplorer
        Set IE = New InternetExplorer
        Dim Doc As HTMLDocument
        Cells.Clear
        mySearch = InputBox("Scrivi il nome da cercare")
        Const myURL As String = "https://www.visionwheel.com/dealers/dealer-search.cfm"
        With IE
            .Navigate myURL
            .Visible = True
            Do While .Busy = True Or .ReadyState <> READYSTATE_COMPLETE
                Application.Wait Now + TimeValue("00:00:04")
            Loop
        End With
        Set Doc = IE.Document
        Doc.getElementsByTagName("input")(0).Value = mySearch
        Doc.getElementsByClassName("button search-button").Item.Click
        Sleep 4000
        For Each a In Doc.getElementsByClassName("contact-info")
            i = i + 1
            Cells(i, 1) = a.innerText
        Next
        IE.Quit
        Set IE = Nothing
        Set Doc = Nothing
    End Sub

  5. #5
    Seeker ges's Avatar
    Join Date
    Jul 2019
    Location
    Italy
    Posts
    5
    Articles
    0
    Excel Version
    2016
    Hi, try this
    Code:
    #If VBA7 Then
    Public Declare PtrSafe Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As LongPtr)
    #Else
    Public Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
    #End If
    
    Sub WebDAta()
        Dim IE As InternetExplorer
        Set IE = New InternetExplorer
        Dim Doc As HTMLDocument
        Cells.Clear
        mySearch = InputBox("Scrivi il nome da cercare")
        Const myURL As String = "https://www.visionwheel.com/dealers/dealer-search.cfm"
        With IE
            .Navigate myURL
            .Visible = True
            Do While .Busy = True Or .ReadyState <> READYSTATE_COMPLETE
                Application.Wait Now + TimeValue("00:00:04")
            Loop
        End With
        Set Doc = IE.Document
        Doc.getElementsByTagName("input")(0).Value = mySearch
        Doc.getElementsByClassName("button search-button").Item.Click
        Sleep 4000
        For Each a In Doc.getElementsByClassName("contact-info")
            i = i + 1
            Cells(i, 1) = a.innerText
        Next
        IE.Quit
        Set IE = Nothing
        Set Doc = Nothing
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •