mustilem23 Posted 6 hours ago Posted 6 hours ago (edited) I'm trying to use ControlSetText in AutoIt to input text into the "Name" and "Fuzzy Name" fields on this web page: 👉 https://www.trade.gov/data-visualization/csl-search However, it doesn't seem to work. I suspect it's because the page uses modern web technologies (JavaScript-based elements), and maybe ControlSetText can't interact with them properly. I tried inspecting the elements and using their IDs, but I'm still stuck. I'm very new to this, so I'd really appreciate any help or guidance. Here's the code I'm working with: <input type="text" class="explorer__form__input" id="name" name="name" value=""> <input type="text" class="explorer__form__input" id="name" name="name" value=""> #include <AutoItConstants.au3> ; Open the browser and navigate to the URL Run("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe https://www.trade.gov/data-visualization/csl-search") WinWaitActive("CSL Search") ; Wait for the window title Sleep(5000) ; Try to set the text in the "Name" field ControlSetText("CSL Search", "CSL Search - International Trade Administration", "name", "Kromlüks") Sleep(500) Edited 6 hours ago by mustilem23
Nine Posted 6 hours ago Posted 6 hours ago You would need to use WebDriver : “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
ioa747 Posted 5 hours ago Posted 5 hours ago The above method is the correct one However, there is also the beginner's method. ;~ Opt("SendKeyDelay", 100) ; Slow motion ; Open the browser and navigate to the URL Run("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe https://www.trade.gov/data-visualization/csl-search") Local $hWnd = WinWaitActive("CSL Search", "", 5) ; Wait Max 5 sec for the window title If $hWnd Then Send("{TAB 19}") ; go to the name field Send("Kromlüks") ; set the name Send("{TAB 5}") ; go to the search button Send("{ENTER}") ; execute the search Else ConsoleWrite("I can't find the 'CSL Search' window." & @CRLF) EndIf I know that I know nothing
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now