Our training courses

Other training resources

Our training venues

Why we are different

Details for srikanth

srikanth has participated in the following threads:

Added by srikanth on 16 May 2020 at 20:19

Hello Andrew, this is Srikanth here, I am trying to get the data from a website "www.gst.gov.in". Once the login page is loaded the Internet Explorer ready state is complete but there are other things load after the Internet Explorer's ready state is complete due to which the I am getting error in finding the elements. How to wait untill the animation is complete and inner page is loaded? I don't want to use the wait function. InternetExplorer is not able to identify that the inner page is not yet loaded so its ready state shows as completed.

Below is my code, please help me in this.

Sub WebScraping()

Dim IE As New SHDocVw.InternetExplorer
Dim Documents As MSHTML.HTMLDocument
Dim Element As MSHTML.IHTMLElement
Dim Elements As MSHTML.IHTMLElementCollection
Dim UserName As MSHTML.IHTMLElement
Dim Password As MSHTML.IHTMLElement

IE.Visible = True
IE.navigate "https://www.gst.gov.in/"

Do Until IE.readyState = READYSTATE_COMPLETE
Loop

Set Documents = IE.document

'For Login Page Click
Set Elements = Documents.getElementsByTagName("a")
For Each Element In Elements
If Element.getAttribute("target") = "_self" And Element.getAttribute("href") = "//services.gst.gov.in/services/login" Then
Element.Click
Exit For
End If
Next Element

'UserID
Set UserName = Documents.getElementById("username")
UserName.Value = "Username"

End Sub

 

Head office

Kingsmoor House

Railway Street

GLOSSOP

SK13 2AA

London

Landmark Offices

99 Bishopsgate

LONDON

EC2M 3XD

Manchester

Holiday Inn

25 Aytoun Street

MANCHESTER

M1 3AE

© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.

End of small page here
Please be aware that our website uses cookies!
I'm OK with this Tell me more ...