Jump to content

Can't click the Button with Chrome


Recommended Posts

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

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

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

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.

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

mtizzle981,

Please let me know the URL of the page in question - via PM if you wish it to remain confidential. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

  • Moderators

mtizzle981,.

I have just sent you a PM - look at top right in the drop-down next to your user-name. :)

m23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...