sigil Posted January 13, 2010 Share Posted January 13, 2010 I'm trying to open IE to Google Maps, then enter an address and search for it. So far I have: $oIE=_iecreate("maps.google.com") $searchform=_ieformgetcollection($oIE,0) $query=_ieformelementgetcollection($searchform,0) _IEFormElementSetValue ($query, "los angeles, ca") _ieformsubmit($searchform) But that doesn't set any value into the search input box. I've looked over the source code for the Google Maps page, and I think I've got the right form and element--not entirely sure about that, it's hard for me to figure out what's going on in the source for this page. Any ideas? Link to comment Share on other sites More sharing options...
DaleHohm Posted January 13, 2010 Share Posted January 13, 2010 Please show the output to the SciTe console Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
sigil Posted January 13, 2010 Author Share Posted January 13, 2010 (edited) Please show the output to the SciTe consoleNo errors; this is all I got:>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut >Exit code: 0 Time: 2.336 Edited June 2, 2010 by sigil Link to comment Share on other sites More sharing options...
KaFu Posted January 14, 2010 Share Posted January 14, 2010 #include <IE.au3> $oIE=_iecreate("maps.google.com") $oForm = _IEFormGetObjByName ($oIE, "q_form") $oQuery = _IEFormElementGetObjByName ($oForm, "q_d") _IEFormElementSetValue ($oQuery, "los angeles, ca") _IEFormSubmit ($oForm) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sigil Posted January 14, 2010 Author Share Posted January 14, 2010 #include <IE.au3> $oIE=_iecreate("maps.google.com") $oForm = _IEFormGetObjByName ($oIE, "q_form") $oQuery = _IEFormElementGetObjByName ($oForm, "q_d") _IEFormElementSetValue ($oQuery, "los angeles, ca") _IEFormSubmit ($oForm) Hey, that works perfectly. Thanks! Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 14, 2010 Share Posted January 14, 2010 (edited) There are no errors, technically, but the element you want is nowhere near index=0. This is what the HTML looks like: <form id=q_form action=/maps target=vp onsubmit="return onSearch(this)"> <input type=hidden name=f value=q> <input type=hidden name=source value=s_q /> <input type=hidden name=output value=js /> <input type=hidden name=hl value=en /> <input type=hidden name=geocode value="" /> <div id=logo class=srchcol> <a href=/maps?ct=reset> <img class=logo-img src=/intl/en_us/images/maps_small_horizontal_logo.png width=169 height=40 alt="Go to Google Maps Home" /> </a> </div> <div class="srchcol controls"> <input type=text id=q_d name=q title="Search the map" tabindex=1 maxlength=2048 autocomplete=off value="" /> <span id=so style=display:none> <select name=mrt id=mrtbox disabled=true onchange=setSrchEx(this.value);><option value=all selected=selected>All results</option> <option value=loc>Locations</option> <option value=yp>Businesses</option> <option value=kmlkmz>User-created content</option> <option value=ds>Related maps</option> <option value=realestate>Real estate</option> </select> </span> <input type=submit id=q-sub name=btnG tabindex=2 class=btn value="Search Maps" /> <span id=solink> <a href=javascript:void(0) log=showss onclick="return setMrt('all');" id=showss>Show search options</a> <a href=javascript:void(0) log=hides onclick="return setMrt(null);" id=hidess style=display:none>Remove search options</a> </span> <div class=example><span id=srchex>Find businesses, addresses and places of interest.</span> </div> </div> </form> It works if you use: $searchform = _IEFormGetObjByName($oIE, "q_form") $query = _IEFormElementGetObjByName($searchform, "q_d") Edit: Rats, out-typed by KaFu! Edited January 14, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
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