Jump to content
Sign in to follow this  
karudish

Can't get id of an element

Recommended Posts

karudish

Hi, i use Firebug to get information about buttons i want to click with _FFClick (from FF.au3 UDF), but now i found a button that doesn't have neither id, nor name or tag (or if it does i cant see it).. How can i simulate a click then?
 
Ps. Dont know if it matters, but the html code of the button is the "<span></span>" line on this code below:

<dd>
   <div class="variant-holder">
   <div class="variant-holder">
   <div class="variant-holder">
   <div class="variant-holder">
      <input id="Animes" type="radio" value="Animes" onchange="this.form.submit();" name="TypeAction">
         <label for="Animes">
         <span></span>
         Animes
         </label>
   </div>
</dd>
Edited by karudish

Share this post


Link to post
Share on other sites
Danp2

Not sure that I follow your description of the issue. This doesn't work?

$oButton = _FFXPath( "//input[@id='Animes']" )
_FFClick($oButton)
Edited by Danp2
  • Like 1

Share this post


Link to post
Share on other sites
karudish

@Danp2, thanks for response, however that doesn't work. On SciTE appears this:

__FFSend ==> Socket Error
_FFCmd ==> Error return value
__FFSend ==> Socket Error
_FFCmd ==> Error return value
_FFClick ==> No match: $sElement: FFau3.xpath
 
Also, the _FFXPath Function is returning "OBJECT|FFau3.xpath" to the variable $oButton, was that supposed to happen?
 
ps. i also removed the extra bracket at the end of you code.

Share this post


Link to post
Share on other sites
Danp2

You've posted limited info, so as I stated earlier I'm not sure that I understand the issue.

On SciTE appears this:

__FFSend ==> Socket Error
_FFCmd ==> Error return value
__FFSend ==> Socket Error
_FFCmd ==> Error return value

This is concerning... do you have Mozrepl installed and running?

Also, the _FFXPath Function is returning "OBJECT|FFau3.xpath" to the variable $oButton, was that supposed to happen?

I believe this is the expected behavior.

ps. i also removed the extra bracket at the end of you code.

Thanks! :doh:

  • Like 1

Share this post


Link to post
Share on other sites
karudish

Its working now! I don't know why, neither how it's working, but i think it was a problem with my script! Thank you very much :D

Btw, the code that you posted won't work alone.. I put it this way to work:

If _FFConnect(Default, Default, 3000) Then
   $oButton = _FFXPath( "//input[@id='Animes']" )
   _FFClick($oButton)
EndIf

Maybe i should know that it needed to be that way from the beggining  :sweating: but i'm really inexperienced with AutoIT :(( I didn't really understood what your code does xD but anyway i get the result i want

I'll mark this post as solved, but i'll make sure that i'll investigate a bit more about that "object" thingy eheh

Thank you again.

Edited by karudish

Share this post


Link to post
Share on other sites
Danp2

Glad you got it working. FWIW, I knew the code wouldn't work as posted. It was just a snippet of code designed to be plugged into your existing script.

The first line of the code you posted retrieves the input field with the ID equal to "Subscriber". This wasn't in the original html that you posted; What website are you automating?

Share this post


Link to post
Share on other sites
karudish

Yeah i know, i changed that to protect the anonymity of my script. I noticed that here in the forum there are some rules against teaching about game automation, the more my script was about to automate some clicks on youtube, i got afraid that nobody would help me if i said for what it was in the first place :( .. Though it is not a spam bot script neither nothing harmful, don't worry :)

Share this post


Link to post
Share on other sites
Danp2

Not sure why you were concerned about game automation if you aren't interacting with a game. :ermm:

Chances are that people won't help when they feel that they are being misled.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×