Results 1 to 2 of 2

Thread: Click on javascript generated button via InternetExporer

  1. #1

    Thread Starter
    Addicted Member Fonty's Avatar
    Join Date
    May 2006
    Location
    New York
    Posts
    173

    Question Click on javascript generated button via InternetExporer

    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.

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

    HTML Code:
       <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>
    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?

    Thanks,

    Samuel


  2. #2

    Thread Starter
    Addicted Member Fonty's Avatar
    Join Date
    May 2006
    Location
    New York
    Posts
    173

    Re: Click on javascript generated button via InternetExporer

    Anyone?

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width