Im trying to automate a website to look up address. it has a search box that when you type in it it lists suggested address in a list under the searchbox.
im trying to retrieve the values that it suggests.
the below code navigates to the website and sets a value in the search box but no suggestions appear
WB := ComObjCreate("InternetExplorer.Application")
WB.Visible := true
WB.Navigate("https://mapshare.vic.gov.au/MapShareVic/index.html?viewer=MapShareVic.PublicSite")
msgbox wait until site is loaded then push ok
buttons := WB.document.getElementsByTagName("button")
;Click agree on the dialog that appears
loop % buttons.length
{
if(buttons[a_index-1].innerHTML = "Agree"){
buttons[a_index-1].click()
break
}
}
WB.document.getElementsByName("search")[0].value := "10 glenfern road"
is there a way to get them to appear after i have set the value?
any help would be appreciated
the results i want to appear
what is currently happening
Help With IE COM Input box that has autocomplete results
- Sir Teddy the First
- Posts: 94
- Joined: 05 Aug 2019, 12:31
- Contact:
Re: Help With IE COM Input box that has autocomplete results
Hi,
what you have to do:
You select the searchbox via ".Select()" and then use ControlSend to send text.
Why you have to do this
The website is waiting for physical keystrokes to be sent, not just a changed value.
The Code would be something like this:
This should work.
You might have to put a sleep inbetween the first two lines, depending on how fast the website reacts.
what you have to do:
You select the searchbox via ".Select()" and then use ControlSend to send text.
Why you have to do this
The website is waiting for physical keystrokes to be sent, not just a changed value.
The Code would be something like this:
Code: Select all
WB.document.getElementsByName("search")[0].Select()
window := WB.hwnd ; here you retrieve the window handle for your COM-Object
ControlSend,Internet Explorer_Server1, %YOURTEXT%, ahk_id %window%
You might have to put a sleep inbetween the first two lines, depending on how fast the website reacts.
Who is online
Users browsing this forum: FanaticGuru, OrangeCat and 148 guests