Can't use querySelector in the right way in vba

前端 未结 4 778
醉酒成梦
醉酒成梦 2021-01-14 21:48

I\'ve written some code using vba to get all the movie names from a specific webpage out of a torrent site. However, pressing \"F8\" I could find out that the code works wel

4条回答
  •  野的像风
    2021-01-14 22:38

    I know this old, but I managed on how to use querySelectorAll without crashes my IE.

    Instead of using For-each I used For Loop

    Example below:

    Dim priceData as Object
    Set priceData = IE.document.getElementsByClassName("list-flights")(0).querySelectorAll("[class$='price']")
    
    
    For i = 0 to priceData.Length - 1
        Debug.Print priceData.item(i).getElementsByClassName("cash js_linkInsideCell")(0).innerHTML
    Next i 
    

提交回复
热议问题