Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have trying to scraping the data from internet. But I have this error.

What I have tried:

Sub testBid()
Dim link As String
        link = "https://www.freelancer.com/projects/php/creating-notification-warning-system/"
        MsgBox (FuncUpdateBid(link))
        'MsgBox (FuncProBudget(link))
End Sub

Function FuncUpdateBid(ByVal Plink As String) As String
    Dim appIE As InternetExplorer
    Set appIE = CreateObject("internetexplorer.application")
    With appIE
        .navigate Plink
        .Visible = True
    End With
    Do While appIE.Busy
        DoEvents
    Loop
    Dim sbid As String
    'Dim Bid As Object
    Dim Bid As IHTMLElement
    Set Bid = appIE.document.getElementById("num-bids")<pre>' <-- error code 424, object required


'Set Bid = appIE.document.getElementsByTagName("num-bids")
sbid = Bid.innerText
FuncUpdateBid = sbid
'FuncUpdateBid = Bid.innerText
appIE.Quit
Set appIE = Nothing
End Function
Posted
Updated 15-Apr-18 23:53pm
v2
Comments
Maciej Los 16-Apr-18 2:45am    
What line?
Richard MacCutchan 16-Apr-18 3:42am    
Use the macro debug feature to step through the code. You can then clearly see which object is not getting set.
hmanhha 16-Apr-18 5:36am    
Set Bid = appIE.document.getElementById("num-bids") ' <-- error code 424, object required
Richard MacCutchan 16-Apr-18 5:52am    
A quick view of the source of that page shows that "num-bids" does not exist. Something you could have found for yourself quite easily.
Maciej Los 16-Apr-18 6:31am    
Hawk eye!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900