Jump to content

Recommended Posts

Posted

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>

 

Posted
  On 10/20/2014 at 7:34 AM, junkew said:

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?

Posted

  On 10/20/2014 at 12:44 PM, JohnOne said:

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!

Posted

Automating a game. reported.

  On 10/20/2014 at 12:57 PM, mtizzle981 said:

#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.

  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted

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.

  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted
  On 10/20/2014 at 2:06 PM, DarthCookieMonster said:

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.

Posted

  On 10/20/2014 at 2:07 PM, Melba23 said:

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!

  • Moderators
Posted

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:

  Reveal hidden contents

 

  • Moderators
Posted

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:

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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