mtizzle981 Posted October 20, 2014 Share Posted October 20, 2014 I am new to AutoIT and am struggling with the code to click a 'Vote' button. I am using Chrome, not IE. I can't figure it out for the life of me. Can anyone help? <div class="pds-vote"> <div class="pds-votebutton-outer"><a id="pd-vote-button8381458" class="pds-vote-button"><span>Vote</span></a> <span class="pds-links"><a href="javascript:PD_vote8381458(1);" class="pds-view-results">View Results</a><br> <span class="pds-clear"></span></span> <span class="pds-clear"></span></div></div> Link to comment Share on other sites More sharing options...
junkew Posted October 20, 2014 Share Posted October 20, 2014 welcome. see FAQ question 31 https://www.autoitscript.com/wiki/FAQ FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
mtizzle981 Posted October 20, 2014 Author Share Posted October 20, 2014 welcome. see FAQ question 31 https://www.autoitscript.com/wiki/FAQ Yes, I performed all of those functions, installed everything properly and can actually run some sample scripts in Chrome. But for some reason, I can not get this button to click with _ChromeInputClickByName() or _ChromeInputClickByType(). I am sure that I am missing something simple, but I am stumped! Any other ideas? Link to comment Share on other sites More sharing options...
JohnOne Posted October 20, 2014 Share Posted October 20, 2014 Show code for better help. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
mtizzle981 Posted October 20, 2014 Author Share Posted October 20, 2014 Show code for better help. #include <Chrome.au3> $gameID = "PDI_answer38130070" $gameValue = "38130070" $gameName = "PDI_answer8381458" $submitID = "pd-vote-button8381458" voteSubmission() Func voteSubmission() Global $oIE = _ChromeStartup("http://www.........") ;wait for page to load before any actions _ChromeDocWaitForReadyStateCompleted() while 1 $oGame = _ChromeObjGetHTMLById($oIE, $gameID) $oSubmit = _ChromeObjGetHTMLByName($oIE, $submitID) Sleep(5000) _ChromeInputSetCheckedWithValueByName($gameValue,$gameName, True) Sleep(5000) _ChromeInputClickByName($oSubmit) Sleep(5000) _ChromeShutdown() Sleep(5000) _ChromeStartup("http://www.........") Sleep(5000) WEnd EndFunc Also, is there a way to 'refresh' in Chrome instead of my shutdown and startup commands? Thank you! Link to comment Share on other sites More sharing options...
Bert Posted October 20, 2014 Share Posted October 20, 2014 Automating a game. reported. #include <Chrome.au3> $gameID = "PDI_answer38130070" $gameValue = "38130070" $gameName = "PDI_answer8381458" $submitID = "pd-vote-button8381458" voteSubmission() Func voteSubmission() Global $oIE = _ChromeStartup("http://www.........") ;wait for page to load before any actions _ChromeDocWaitForReadyStateCompleted() while 1 $oGame = _ChromeObjGetHTMLById($oIE, $gameID) $oSubmit = _ChromeObjGetHTMLByName($oIE, $submitID) Sleep(5000) _ChromeInputSetCheckedWithValueByName($gameValue,$gameName, True) Sleep(5000) _ChromeInputClickByName($oSubmit) Sleep(5000) _ChromeShutdown() Sleep(5000) _ChromeStartup("http://www.........") Sleep(5000) WEnd EndFunc Also, is there a way to 'refresh' in Chrome instead of my shutdown and startup commands? Thank you! is not allowed in forum rules. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 20, 2014 Moderators Share Posted October 20, 2014 mtizzle981, $gameID = "PDI_answer38130070" $gameValue = "38130070" $gameName = "PDI_answer8381458" $submitID = "pd-vote-button8381458"[/quote]You appear not to have read the Forum rules since your arrival. Please do read them - particularly the bit about not discussing game automation. And given the rather suspect nature of the code you posted, please explain exactly what you are trying to automate before we go any further. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
mtizzle981 Posted October 20, 2014 Author Share Posted October 20, 2014 Thanks for keeping me honest. This is not a game site, this is a polling page and the owners are convinced that the voting can't be automated...I beg to differ as I have seen a insane amount of votes in a very short period of time...not possible without a script of some sort. I am trying to show them that it is very possible with a script and am looking for help. Link to comment Share on other sites More sharing options...
Bert Posted October 20, 2014 Share Posted October 20, 2014 (edited) Have you tried to use IE to prove it can be automated? You don't have to use Chrome. Edited October 20, 2014 by DarthCookieMonster The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 20, 2014 Moderators Share Posted October 20, 2014 mtizzle981,Please let me know the URL of the page in question - via PM if you wish it to remain confidential. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
mtizzle981 Posted October 20, 2014 Author Share Posted October 20, 2014 Have you tried to use IE to prove it can be automated? You don't have to use Chrome. Yes, and it works but IE is crashing every 5 minutes or so. Link to comment Share on other sites More sharing options...
Bert Posted October 20, 2014 Share Posted October 20, 2014 sounds like your IE script is buggy. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
mtizzle981 Posted October 20, 2014 Author Share Posted October 20, 2014 mtizzle981, Please let me know the URL of the page in question - via PM if you wish it to remain confidential. M23 ummm...is there something I am missing? Can't find any PM options. Up way too late last night! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 20, 2014 Moderators Share Posted October 20, 2014 mtizzle981,.I have just sent you a PM - look at top right in the drop-down next to your user-name. m23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 20, 2014 Moderators Share Posted October 20, 2014 Hi all,After a PM exchange I am happy that mtizzle981's intentions for attempting to automate the button are not malicious - but we do not want auto-vote code on the forum so the subject is being dealt with off-line. Thread locked. M23 junkew 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts