Click on javascript generated button via InternetExporer

Font

New Member
Joined
Apr 6, 2013
Messages
1
Hi,


I've been trying to "click" on the small right arrow button located at the bottom right corner of the table in this page: https://www.google.com/shopping/product/3223537695897257680/online

I'm stuck and I don't know anymore how to proceed. The XML code takes the form of:

div class="pag-bottom-links">
div class="pag-prev-next-links" id="online-pagination">
div class="pag-n-to-n-txt" id="online-n-to-n-txt"> 1 - 25 of 37 /div>
script>(function(){var section='online';var current_state_param='num:25';var prev_state_param='';var next_state_param='num:25,start:25';pp.ui.createPagination(section,current_state_param,prev_state_param,next_state_param);})();/script>
/div>
div class="next-previous-spacer">/div>
/div>
/div>

Note: I left the tags incomplete because this won't let me post without executing the XML code...

The javascript function takes the form of an anonymous function that I don't know how to call. This is what I have tries with no success:

Code:
Option Explicit


Dim ie As InternetExplorer
Dim ch As Object, obj As Object, obj2 As Object
Dim objInt As Long


Sub online()


    Dim list_name() As String, list_price() As String, list_review() As Variant, list_attributes() As String, table_online As Variant, google_stores As Variant
    Dim i As Long, j As Long
    
    ' Create new IE window
    Set ie = CreateObject("InternetExplorer.Application")
    ie.Navigate "https://www.google.com/shopping/product/3223537695897257680/online"
    
    ' Loop unitl ie page is fully loaded
    Do While ie.Busy: DoEvents: Loop
    Do While ie.ReadyState <> 4: DoEvents: Loop
    ie.Visible = True
   
    Set obj = ie.Document.getElementsByTagName("div")
 
    objInt = 0
    While objInt < obj.Length
        If obj(objInt).className = "pag-prev-next-links" Then Set obj2 = obj(objInt)
        objInt = objInt + 1
    Wend
    
    For Each ch In obj2.Children
        If ch.tagName = "SCRIPT" Then Call ch.FireEvent("next_state_param")
    Next ch
    
End Sub

Thoughts?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,203,691
Messages
6,056,756
Members
444,889
Latest member
ibbara

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top