VBA web scraping automating contents in HTML document without ID and classname

Issue

This Content is from Stack Overflow. Question asked by Crazy Dog

I am trying to automate a process in which entry from a excel cell will be entered in to web form and resulting data will be collected in separated excel cell. However, the webpage HTML doesnt have class or ID. it is run through a jss script. Below is the HTML code –
enter image description here

I am stuck with following VBA code –

Sub updateSRV()

    Dim ie As InternetExplorer
    Dim doc As HTMLDocument
    
    Set ie = New InternetExplorer
    ie.Visible = True
    
    URL = "http://hwrapp:7778/reports/jsprep/umesh/cnote/cnote_query5.html"
    ie.navigate URL
    
    Do Until ie.Busy Or ie.readyState <> READYSTATE_COMPLETE
        DoEvents
    Loop
    
    ie.document.getElementsByTagName$("input[name=cntno]").Value = 20220064

End Sub



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?