DOM Code Help (Internet Explorer webpage clicking fields)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
abj
Posts: 8
Joined: 24 Jul 2021, 08:24

DOM Code Help (Internet Explorer webpage clicking fields)

24 Jul 2021, 08:32

My code without DOM which runs smoothly provided the site loads properly. The site is government site which requires you to enter an alphanumeric called GSTIN to search its details. After entering GSTIN in the field, you have to press tab to enable the captcha code field to show up (otherwise it is not visible). This captcha code I'm unable to show in DOM. The button click system also I'm unable to understand for DOM. The tab code works 90% but I want 99%+ if possible.
Mouse click/keyboard selection on GSTIN on some other page ; thereafter I press the hotkey.

(Use this GSTIN 07ARJPP6864D1ZG for trials of your codes)

Code: Select all

^`::
{
 Send, ^c
 Sleep 50
 Run, chrome.exe --new-window https://services.gst.gov.in/services/searchtp
 WinWait, ahk_exe chrome.exe
 WinMaximize, ahk_exe chrome.exe
 Sleep 1000
 Send {Tab 13}
 Send, ^v
 Sleep 4000
 Send, {Tab}
 Sleep 5000
 Send, {Enter}
 Sleep 200
 Send, {tab 2}
 Send, {space}
 return
}
I don't want to rely on the whims of site loading so I want to use DOM. Had to switch from chrome to iexplore for this

Code: Select all

Send, ^c

URL = https://services.gst.gov.in/services/searchtp

wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := True
WinMaximize, % "ahk_id " WB.HWND
wb.Navigate(URL)

While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy
; wait for the page to load
   Sleep, 10

gstin := wb.document.getElementById("for_gstin")
gstin.value := Clipboard

Sleep 100
wb.document.getElementById("for_gstin").click()
Sleep 100

Send, {Tab}

Sleep 3000

wb.document.getElementById("lotsearch").click()

return
[Mod edit: [code][/code] tags added.]


The code works till clipboard paste only. Rest you guys may try to help me in. I do not have IT background so don't know how all this works.
abj
Posts: 8
Joined: 24 Jul 2021, 08:24

Re: DOM Code Help (Internet Explorer webpage clicking fields)

26 Jul 2021, 00:24

Please someone guide me in this.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Billykid, Descolada, icyolive, Swiftly9767 and 303 guests