teamwhatelse 0 Posted October 3, 2012 Hi there, I'm trying to learn AutoIT and attempting to cut my teeth on some of the examples. I've tried a few examples and I'm getting errors on almost all of them relating to Internet Explorer scripts. For example, the script "Send search to Google": #include <IE.au3> $oIE = _IECreate("http://www.google.co.uk") $oForm = _IEFormGetObjByName($oIE, "f") Local $oQuery = _IEFormElementGetObjByName($oForm, "q") _IEFormElementSetValue($oQuery, "AutoIt IE.au3") _IEFormSubmit($oForm) I get the following error message (and I ran it both in beta mode and normal). --> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch --> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType +>23:52:34 AutoIT3.exe ended.rc:0 Since this was a copy/paste from the example code, I'm struggling to see what I'm doing wrong? Any help GLADLY received. Thanks Share this post Link to post Share on other sites
Danyfirex 671 Posted October 3, 2012 for me that script work correctly. which autoit version do you use? also you can use ShellExecute to open a web page. shellexecute("www.google.com.uk") Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Share this post Link to post Share on other sites
DaleHohm 65 Posted October 4, 2012 Google changed the name of the search form from "f" to "gbqf". Change that in the script and it should work. This is one of the only examples I included that relied on an external webpage. Please don't make a comment like "I've tried a few examples and I'm getting errors on almost all of them" without pointing them out so that they can be corrected, if there is a problem with them. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe 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 Share this post Link to post Share on other sites
teamwhatelse 0 Posted October 6, 2012 Hi there, Thank you so much for the replies. Dale, your suggestion fixed things for me. With reference to the other examples, I should apologise I was using the examples that were listed on the function pages for the Internet Explorer functions and they were all giving the same errors, as listed above. InvalidDatatye and another (cannot remember the error verbatim because it no longer causes an error) and something about an object not being set? Anyway I think a restart of my pc after installing the latest Beta fixed things (I placed the v3395 folder into the AutoIT folder and renamed it Beta). Thanks again for your help. Share this post Link to post Share on other sites
PhoenixXL 168 Posted October 6, 2012 (edited) if you are only concerned with Google Searchthen this works for me in India #include <IE.au3> Local $nSearchTerm='Autoit' $oIE = _IECreate("http://www.google.co.in/webhp#hl=en&sclient=psy-ab&q="&$nSearchTerm) ;Do rest of the Stuff Edited October 6, 2012 by PhoenixXL My code:PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Share this post Link to post Share on other sites
aki2 0 Posted October 6, 2012 (edited) The best way to do Google search or any search is by catching the Text box when u type and then writing into it.. this is the best way and what industries follows. Below is the Code #include $oIE=_IECreate("www.google.com",0, 1, 1, 1) _IELoadWait($oIE) $oSb = _IEGetObjByName($oIE, "q") ;here q is the text box name properity so i am grabing it by its name to variable oSb _IEFormElementSetValue($oSb, "apple") ;here i am sending apple to the variable oSb which is the TEXT box. sleep(5000) Aki2 Edited October 6, 2012 by aki2 Share this post Link to post Share on other sites