DaveOLW Posted April 10, 2019 Posted April 10, 2019 Hi have not used Autoit before on Internet Explorer, have got it open web page where there is search box with the usual "magnifier" (button) to click to start searching. Using the Inspect tool it does not give a Name for the form or for the "magnifier" (button). How do I get the Names?
Nine Posted April 10, 2019 Posted April 10, 2019 Look at IE UDF in help file. Everything you need is in there. “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
DaveOLW Posted April 11, 2019 Author Posted April 11, 2019 21 hours ago, Nine said: Look at IE UDF in help file. Everything you need is in there. Yes have read through that several times. Have found the form name and search box names and can load page insert text into search box and send enter so it opens a list of songs I have searched for to select, but cannot select them. Cannot find the name of the table or the buttons inside the cells? Focus remains on search box and cannot get it go to Button "Report Song". This is the section of HTML code:- <table id="searchResults" class="twelve "><tbody><tr><td ><div id="song-c91404de-bef4-4893-ac4b-4bbe51b81a1b" class="searchResultsSongSummary"><div class="row"><div class="one mobile-one reportAction columns" style="margin-right: 1em;"><span onclick="toggle('c91404de-bef4-4893-ac4b-4bbe51b81a1b'); ga('send','event', 'Add CCL Activity', 'Select', 'Report Song button in Search Results');" class="c91404de-bef4-4893-ac4b-4bbe51b81a1b button blue-dark small reportExpandButton" style="display: inline-block;">Report Song </span><span style="display: none;" class="button small gray-light-2 reportInactiveButton">Report Song</span></div> There is Table id "searchResults" but no name using id does not work, have tried - $oTableOne = _IETableGetObjByName($oForm, "searchResultsSongSummary"). "Report Song" button does not have a name, have tried - Local $oQuery = _IEGetObjByName($oForm, 'Repot Song') My code so far:_ Focus remains on search box and cannot get it go to Button "Report Song". #include <IE.au3> Local $oIE = _IECreate("https://olr.ccli.com/search/results?SearchTerm=") _IELoadWait($oIE) Local $oForm = _IEFormGetObjByName($oIE, 'frmSearchTerm') Local $oQuery = _IEGetObjByName($oForm, 'SearchTerm') _IEFormElementSetValue($oQuery, 'Once Again') Local $hWnd = _IEPropertyGet($oIE, "hwnd") ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}") Local $oSubmit = _IEFormElementGetObjByName($oForm, 'Report Song') _IEAction($oSubmit, "click") Have tried using focus in last line, using enter but that did not work. Any help anyone can give me would be appreciated, thanks. David
Nine Posted April 11, 2019 Posted April 11, 2019 "Report Song" is an innerText. So you could use something like : $colSpan = _IETagNameGetCollection ( $oForm, "span") For $span in $colSpan If $span.innertext = "Report Song" then $span.click () Next Try with $oForm or $oIE, try also with index on collection, not sure which one is best to click on (first or second) “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
DaveOLW Posted April 11, 2019 Author Posted April 11, 2019 Thanks for the reply. Tried this with $oForm and it comes up with Error "Variable must be of Type "Object" Tried with $oIE with collection and collection with index, it does nothing, tried with $oForm and collection with index, does nothing. David
Nine Posted April 11, 2019 Posted April 11, 2019 3 minutes ago, DaveOLW said: Tried this with $oForm and it comes up with Error "Variable must be of Type "Object" Well, it should have gave you the same error in your code. Did you try only my few lines ? Cause it needs the rest of your code before ! “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
DaveOLW Posted April 11, 2019 Author Posted April 11, 2019 #include <IE.au3> Local $oIE = _IECreate("https://olr.ccli.com/search/results?SearchTerm=") _IELoadWait($oIE) Local $oForm = _IEFormGetObjByName($oIE, 'frmSearchTerm') Local $oQuery = _IEGetObjByName($oForm, 'SearchTerm') _IEFormElementSetValue($oQuery, 'Once Again') Local $hWnd = _IEPropertyGet($oIE, "hwnd") ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}") Sleep(2000) $colSpan = _IETagNameGetCollection($oForm, "span") For $span in $colSpan If $span.innertext = "Report Song" then $span.click () Next
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