Web Scrapping - Input data from Excel and pull data from website to adjacent column using Macros

Viewed 30

I'm facing difficulty in getting the requisite data and entering the captcha system in this website https://einvoice1.gst.gov.in/Others/EinvEnabled

I need to input the GSTIN from a excel sheet and enter the Captcha and extract the DATA inside the Final result page.

27AABCC6610Q1ZE 09AAFCS7675H1ZS 06AACCA4260B1ZC and so on

There are 1000's of GSTIN

I want to give a timeframe of 15 seconds to enter the Captcha manually in case not possible through macros.

Please review it and lemme know the correct VBA code

Sub OpenHyperlinkInChrome()
 Dim chromeFileLocation As String
  Dim hyperlink As String
  hyperlink = "https://einvoice1.gst.gov.in/Others/EinvEnabled"
  chromeFileLocation = """C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"""
  Shell (chromeFileLocation & "-url " & hyperlink)
  
    DoEvents
    Range("A2").Select

Do Until IsEmpty(ActiveCell)

    Application.Wait Now + TimeValue("00:00:15")
    
IE.document.all("GSTIN").Value = ActiveCell.Value
    
    Set tags = IE.document.getElementsByTagName("Input")
For Each tagx In tags
    If tagx.Value = "Next" Then
        tagx.Click
        Exit For
    End If
Next

Loop

End Sub
 

0 Answers
Related