Sign in to follow this  
Followers 0
mtizzle981

Can't click the Button with Chrome

15 posts in this topic

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>

 

Share this post


Link to post
Share on other sites



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?

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0