Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Excel vba - extracting data from webpage using msxml2.xmlhttp

  1. #11
    New Member
    Join Date
    Dec 2018
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel vba - extracting data from webpage using msxml2.xmlhttp

    Hi Domenic , Thanks , will use both as per requirement (accuracy/speed). many Thanks.

    Just wanted to know , Can we extract data from a login/password protected webpage using xmlhttp? If yes , i will open a new thread for that.

  2. #12
    MrExcel MVP
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    18,574
    Post Thanks / Like
    Mentioned
    26 Post(s)
    Tagged
    4 Thread(s)

    Default Re: Excel vba - extracting data from webpage using msxml2.xmlhttp

    It should be possible, so yes start a new thread and ask your question there.

    Cheers!

  3. #13
    New Member
    Join Date
    Dec 2018
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel vba - extracting data from webpage using msxml2.xmlhttp

    Sub Button1_Click()
    Dim StartTime As Double
    Dim SecondsElapsed As Double
    StartTime = Timer
    'Application.ScreenUpdating = False
    For i = 1 To 14
    On Error Resume Next
    Dim IE As New InternetExplorer
    IE.Visible = True
    'IE.navigate "https://sellercentral.amazon.in/orders-v3/search?page=1&q=" & Range("Asin9")(i, 1).Value & "&qt=asin&date-range=last-1"
    'IE.navigate "https://sellercentral.amazon.in/orders-v3/search?page=1&date-range=1517077800000-1518632999000&q=" & Range("Asin9")(i, 1).Value & "&qt=asin"
    'Do
    'DoEvents
    'Loop Until IE.readyState = READYSTATE_COMPLETE
    'Dim Doc5 As HTMLDocument
    'Set Doc5 = IE.document
    'Application.Wait Now() + TimeValue("00:00:004")
    'Range("Asin9")(i, 2).Value = Doc5.getElementsByClassName("total-orders-heading")(0).innerText
    'Application.ScreenUpdating = True
    'IE.navigate "https://sellercentral.amazon.in/orders-v3/search?page=1&q=" & Range("Asin9")(i, 1).Value & "&qt=asin&date-range=last-1"
    'Do
    'DoEvents
    'Loop Until IE.readyState = READYSTATE_COMPLETE
    'Dim Doc6 As HTMLDocument
    'Set Doc6 = IE.document
    'Application.Wait Now() + TimeValue("00:00:004")
    'Range("Asin9")(i, 4).Value = Doc6.getElementsByClassName("total-orders-heading")(0).innerText
    'Application.ScreenUpdating = True
    IE.navigate "https://sellercentral.amazon.in/orders-v3/search?page=1&date-range=1548613800000-1550168999000&q=" & Range("Asin9")(i, 1).Value & "&qt=asin"
    Do
    DoEvents
    Loop Until IE.readyState = READYSTATE_COMPLETE
    Dim Doc7 As HTMLDocument
    Set Doc7 = IE.document
    Application.Wait Now() + TimeValue("00:00:004")
    Range("Asin9")(i, 6).Value = Doc7.getElementsByClassName("total-orders-heading")(0).innerText
    Application.ScreenUpdating = True
    Next
    'Application.ScreenUpdating = True
    SecondsElapsed = Round(Timer - StartTime, 2)
    MsgBox "Refresh Completed in" & SecondsElapsed & " seconds", vbInformation
    End Sub

  4. #14
    Board Regular
    Join Date
    Oct 2015
    Location
    Italy
    Posts
    415
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Excel vba - extracting data from webpage using msxml2.xmlhttp

    Hi nkaggarwal1,
    I use this line of code to wait for webpage content fully loaded
    Code:
    Do While IE.Busy Or IE.ReadyState <> 4: DoEvents: Loop
    Give it a try and let us know.
    Have a nice weekend
    .___ ................___
    | _ \ ..............| _ \
    | _ < ..............|. _/
    |___/.___..___..___.|_|
    .....|___||___||___|

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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