smahdi83 Posted July 18, 2007 Share Posted July 18, 2007 Hi, Im trying to automate some things on the yellowpages.com website. But I get to a point where Im trying to check a checkbox but it doesnt work. To know what Im talking about please go to www.yellowpages.com. In the "FIND" text field, type "restaurants" and in the "LOCATION" text field, type "GA". Once you hit "FIND", you will find a checkbox labeled "Check All". I would like to check that box, I've tried all sorts of things but I cant get it to work. Can anyone please help? Here's my code so far. Thanks, #include <IE.au3> $category = "restaurants" $state = "GA" $oIE = _IECreate ("www.yellowpages.com") _IELoadWait($oIE) $oForm = _IEFormGetCollection ($oIE, 0) $oText = _IEFormElementGetObjByName ($oForm, "search_terms") _IEFormElementSetValue ($oText, $category) $oText = _IEFormElementGetObjByName ($oForm, "geo_location_terms") _IEFormElementSetValue ($oText, $state) _IEFormSubmit ($oForm) _IELoadWait($oIE) $oForm = _IEFormGetCollection ($oIE,3) $oQuery = _IEGetObjByName ($oForm, "all") MsgBox(0,"",$oQuery.name) _IEFormElementCheckBoxSelect($oForm,16,"all",1,"byIndex") Link to comment Share on other sites More sharing options...
DaleHohm Posted July 18, 2007 Share Posted July 18, 2007 Sorry, that is an open bug in the CheckBoxSelect function when there is only a single box in a set. Here is a workaround: #include <IE.au3> $oIE = _IEAttach("Looking for restaurants") $oBox = _IEGetObjById($oIE, "all") _IEAction($oBox, "click") Dale 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...
smahdi83 Posted July 18, 2007 Author Share Posted July 18, 2007 Sorry, that is an open bug in the CheckBoxSelect function when there is only a single box in a set. Here is a workaround: #include <IE.au3> $oIE = _IEAttach("Looking for restaurants") $oBox = _IEGetObjById($oIE, "all") _IEAction($oBox, "click") Dale Thanks alot! I appreciate it. It works! 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