Sign in to follow this  
Followers 0
Mechaflash

ff.au3 get text of an element by class

3 posts in this topic

Trying out the ff.au3 and wanting to get the text of an element by class. I see _FFGetValue() but all of the are void of the syntax for it ;) . Is there another function I'm supposed to use for this?


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This is how I use that function in some code I have, I don't know if this'll help or not.. but,

$Spammer[0] = _FFGetValue("it_user[username]_1", "id")

Also, here's a link to documentation on the author's site - FireFox Management.

edit: sorry, just realized my link can be got from yours..

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Was digging around yesterday and found a lot of commands with the same format, so I used it in that way except specified "class" instead of "id"... however It didn't pull the text of the element. It returns 0 so it's acting like it's working. I'm just uncertain how it works altogether cause I couldn't even get _FFClick() to work properly either.


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

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  
Followers 0

  • Similar Content

    • rte7
      By rte7
      Hello. We work with the BMC Remedy site to manage incidents and would like to automate the processes of clicking through this button code:
      <a href="javascript:" class="btn btn3d menu" style="top:21; left:184; width:21; height:21;"> <img class="btnimg" src="../../../../resources/images/mt_sprites.gif" alt="menu category issue" title=""> </a> I use firefox with mozrepl and autoit with include FF.au3
      I need your help
      I read the topic https://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/ but I could not run the code from the listed commands
      ...
      It is necessary to press the button and from the list of the menu of cahorsations to select the item = "zone of trust abonent"
      Screen # 1 http://joxi.ru/52aJK7bh4a7ypA or below.
      1) Press button
      <a href="javascript:" class="btn btn3d menu" style="top:21; left:184; width:21; height:21;"> <img class="btnimg" src="../../../../resources/images/mt_sprites.gif" alt="menu category issue" title=""> </a>
      2) After pressing the button, I need to choose in this menu of 4 items to select an item called "zone of trust abonent", Screen # 2 - http://joxi.ru/p27gwQKHo71VQ2
      html code table items
      <table class="MenuTable" cellpadding="0" cellspacing="0" style="width: 179px;"> <tbody class="MenuTableBody"> <tr class="MenuTableRow"> <td class="MenuEntryName" nowrap="">zone of trust abonent</td> <td class="MenuEntryNoSub" arvalue="zone of trust abonent"></td> </tr> <tr class="MenuTableRow"><td class="MenuEntryName" nowrap="">zone of trust operator</td> <td class="MenuEntryNoSub" arvalue="zone of trust operator"></td> </tr> <tr class="MenuTableRow"><td class="MenuEntryName" nowrap="">zone of trust third operator</td> <td class="MenuEntryNoSub" arvalue="zone of trust third operator"></td></tr> <tr class="MenuTableRow"><td class="MenuEntryNameHover" nowrap="">No settings</td> <td class="MenuEntryNoSubHover" arvalue="No settings"></td> </tr> </tbody> </table>
       
       
      More in detail, I choose from the menu item "zone of trust abonent" Screen # 3 - http://joxi.ru/GrqVq4ZIQEPW4m

       
      3) The choice is made, Screen # 4 http://joxi.ru/v297w6aC3PovLr
      <textarea class="text sr " wrap="off" id="arid_WIN_0_1000002488" cols="20" maxlen="60" style="top:21; left:0; width:179; height:21;" armenu="CFG:PRC:CategoryHPD-Res-T1-Q" mstyle="2" arautoc="1" arautocmb="1" arautocak="0" arautoctt="400" rows="1"> </textarea>
       
      It's all. I would be very grateful to you =) !!!!!!!!!!
      Here are more detailed codes in the attachment. 
      button1.txt
      menu - table.txt
      all.txt
    • milos83
      By milos83
      How can I check if element is focused in Firefox using FF.au3 UDF?
      This is my try:
      I have prepared a function that checks if the object is focused:
       
      _FFCmd('FFau3.isfocused=function isfocused(a){try{return (a === document.activeElement)}catch(e){return}}') $oElm = _FFXPath("//*[@id='someId']") ConsoleWrite(_FFIsFocused($oElm)) Func _FFIsFocused($sElement = "") Local $isFoc = _FFCmd("FFau3.isfocused(" & $sElement & ")") Return $isFoc EndFunc ;==>_FFIsFocused Now, the javascript part is tested and it does return successfully.
      After a lot of try/fails I inserted an alert box in order to display the object being compared.
      Here is what I got
       
      The focused object is: [object XULElement]
      The object that I send for comparing is [object HTMLInputElement]
      Why is that?
       
       
    • Mbee
      By Mbee
      I'm trying to determine the latest/easiest/best way (as of May 2016) to control & interact with Firefox using Autoit.
      To the best I've been able to determine, there have been two different ways to do this. Once upon a time, there was something called "Mozilla ActiveX control", but given all the security warnings I receive whenever I try to download it (the original host site appears to be absent or invalid), I'd prefer to avoid it. The other approach is/was to use a UDF called "FF.au3" developed -- but apparently no longer supported for English speakers -- by Stilgar (old thread is here: https://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/). The most recent thread I could find (in English) was started by Danp2 here: https://www.autoitscript.com/forum/topic/167661-ffau3-v0601b-15/
      Although it certainly seems like using the FF UDF is the most recent and possibly only still-valid approach, getting anything sufficiently useful done with it strikes me as rather difficult, in part because the English documentation is so incomplete as to be unhelpful (and apparently incorrect as well), but also because it appears that to accomplish what I need to do might well require intimate knowledge of Firefox internals or APIs (maybe XULs too).  For example, there are functions such as _FFCmd() that takes arbitrary/undocumented strings, and _FFGetValue() and_FFSetValue() with no English documentation at all (besides the minimal function descriptions in the FF.au3 file itself).
      So, my question is: What is the latest and/or easiest and/or best way of interacting with Firefox using Autoit?  And what else do I need to learn first in order to use it effectively (such as Firefox developer APIs, etc)?
      Thanks!
    • michaelslamet
      By michaelslamet
      I have 2 exe file (autoit's compiled script) running. Both are using FF.AU3. When 1 of the script execute _FFQuit() command, why does it close both firefox browser? 
      Shouldn't it only close it's own firefox and left the other firefox untouchable?
      Thanks!
       
    • michaelslamet
      By michaelslamet
      I'm trying to automate login on this site in the last few days, and I have to admit it drive me crazy.
      Seems like there is no solution.
      The site is rumah123 dot com
      Click on the "Login atau Daftar" link at top right screen.
      (I am using this code that work beautifully to click on that link):
      $oInput = _FFXPath('//*[@data-target="#LoginAgentModal"]') Sleep(250) _FFDispatchEvent($oInput, 'keypress', 13) A login form will displayed.
      The problem no matter what code I tried, it can not fill the "username" and "password" part.
      Tried these without success:
      _FFXPath('//input[@id="username"]') _FFCmd("FFau3.xpath.value='me@me.com'") _FFSetValue("me@me.com", "username", "id") _FFSetValue("$me@me.com", "username", "name") Tried also with SEND command, but the SEND command is very not reliable: sometime it works, sometime not:
      BlockInput(1) Sleep(500) WinActivate("[CLASS:MozillaWindowClass]", "") Sleep(50) For $a = 1 to 5 Sleep(50) Send("{TAB}") Next Sleep(50) Send($Username[1]) Sleep(50) Send("{TAB}") Sleep(50) Send($Password[1]) Sleep(50) Send("{TAB}") Sleep(50) Send("{SPACE}") BlockInput(0) Is there is any way to automate this kind of form/site using FF.AU3 ?
      Thanks a lot!