Jump to content

Recommended Posts

Posted (edited)

I used your mousemove together with another property of event: event.target   , so all is simplified without the need of coord!

#include <FF.au3>
_FFConnect(Default, Default, 3000)

_FFCmd("var evt=null;")
_FFCmd("function listener(event) {evt = event};")
_FFCmd("content.document.addEventListener('mousemove',listener, false);")

while 1
    local $element = _FFCmd("evt.target.nodeName;")
    _FFCmd("evt.target.href")
       Sleep(1000)
WEnd

BTW:

In these examples I always used global var declared

_FFCmd("var evt=null;")

to access them with:

_FFCmd("evt")

With this method you can't access local var in func.

Is it possible to directly access a variable inside a func?

Like accessing "num" inside test()?

_FFCmd("function test() { var num = 10 };")
Edited by frank10
  • 1 month later...
Posted

R.E. FF.au3 version 0.6.0.1b-10

Line # 4329  is missing a back-slash inside the function __FFStartProcess.

$sHKLM &= 'Mozilla\Mozilla Firefox'

Change to:

$sHKLM &= 'Mozilla\Mozilla Firefox\'

Thanks Stilgar for your awesome UDF!

  • 2 weeks later...
Posted

im wanting to automate firefox like you can do with IE, am i correct in assuming i can do it using htis UDF and mozrepl?

Ive installed mozrepl and the UDF and have tried some example scripts but getting errors.. ive tried reading the step by steps but without any luck :(

Posted (edited)

Had that marked already, figured out what it was - telnet feature wasnt turned on in windows lmao.

Now im having an issue with repl though if i press any button in cmd it straight away says referenceError - any idea for this? i know it is a little off topic.. could be permission restrictions maybe or?

*EDIT* - all good, downloaded putty and now its working sweet yay!

My 'view' of this is to automate firefox like you can do with IE in autoit... is my view of this correct? and do i need to do anything with mozrepl or just simply have it installed? 

Edited by 13lack13lade
Posted (edited)

Running sweet, this is absolutely brilliant! props to the creator! 

 

How do i enter say, a user name and password into a username and password box?

Ive inspected the elements to get the information about the inputs:

<input class="gwt-TextBox" type="text" name="j_username"></input>

<input class="gwt-PasswordTextBox" type="password" name="j_password">

how does one input data into these input boxes? was looking at the commands closes thing i saw was _FFsetvalue but it didnt have any help attached with it..

Edited by 13lack13lade
  • 2 weeks later...
Posted

Dear, im trying to make an autologin to this site :id.zing.vn

<input tabindex="1" value="" autocomplete="off" class="input_login" type="text" name="u" id="login_account" placeholder="Tên, email hoặc số điện thoại">

and this is my code:

#Include <FF.au3>
_FFStart()
$oFF1 = _FFOpenURL("https://id.zing.vn/v2?pid=38")
_FFSetValueByName("u","Hoang")
 
Although i can connect to FF but it keep saying that :
 
"G:UsersBang HoangDesktopBlog.au3" (4) : ==> Unknown function name.:
_FFSetValueByName("u","Hoang")
^ ERROR
 
Any ideas to help me out :(
Posted

Dear, im trying to make an autologin to this site :id.zing.vn

 

<input tabindex="1" value="" autocomplete="off" class="input_login" type="text" name="u" id="login_account" placeholder="Tên, email hoặc số điện thoại">

and this is my code:

 

#Include <FF.au3>

_FFStart()

$oFF1 = _FFOpenURL("https://id.zing.vn/v2?pid=38")

_FFSetValueByName("u","Hoang")

 

Although i can connect to FF but it keep saying that :

 

"G:UsersBang HoangDesktopBlog.au3" (4) : ==> Unknown function name.:

_FFSetValueByName("u","Hoang")

^ ERROR

 

Any ideas to help me out :(

nevermind i found my problem :D
Posted

Has anyone had any luck grabbing/utilizing the jQuery object for a page that has it loaded?

AutoIt Example:

_FFCmd("jQuery('#some_id').val()") <-- This would typically return a String with the value of the selected element.

I've also tried: _FFCmd("jQuery('#some_id').val()", Default, 0) and _FFCmd("jQuery('#some_id').val()", Default, 1)

I know it's redundant, but here are 2 JavaScript examples of getting and setting the value using jQuery:

JavaScript Example:

var $ = jQuery;

// Getting the value

$('#some_id').val(); // Gets the value of the element with id="some_id"

// Setting the value

$('#some_id').val('Hello World'); // Sets the value of the element with id="some_id"

...for even more redundancy...here is a bookmarklet that alerts the value in the browser:

Bookmarklet Example:

javascript:alert(jQuery('#some_id').val());
 

I think it's a scoping issue, but I'm not quite sure...I can run a bookmarklet with the same code and get the value returned, but for some reason have never been able to touch the jQuery object from within ff.au3.

I have tried many variations of the _FFCmd function but just can't seem to grab it.  If you have a working solution (aka no guesses) please let me know.  

Thanks!

Posted (edited)

How do you control buttons which are written in java, they dont have any name or id that i can see from the source... or is it not possible to do this?

for example i inspect an element and all that is returned is - <div class="html-face"></div>

however the other buttons say the same thing...

anyway to interact with these?

Edited by 13lack13lade
Posted (edited)

Hi the download the FF.au3 , from IE or Chrome

 - you get compile error...

the end of line character or_ -> or _ FYI..

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Temp\mse2\cliphist2\FF2.au3"
C:\Temp\mse2\cliphist2\FF2.au3 (3906) : ==> Missing separator character after keyword.: 
Return StringRegExp($IP, $sStart & '(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])' & $sEnd) Or_ 
Return StringRegExp($IP, $sStart & '(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])' & $sEnd) Or_^ ERROR
>Exit code: 1    Time: 0.213

line 3906

 Or_ -> Or _ (4 occurances)
    

Edited by ozmike
Posted

@mootius:

The function _FF_Call is for executing JavaScripts:

FFEx.au3

@13lack13lade:

You can interact with them e.g. with _FFXpath and _FFClick.

Look please on the examples: _FFClick and _FFXpath

The XPath can you copy from FireBug.

@stilgar:

Brilliant!  Thanks for the heads up.  So now I am at a new quandary...

If I use this code:

_FF_Call("jQuery('#email').val('me@gmail.com')")

It works as expected and sets the input element with the id=email to me@gmail.com.

However if i then do this:

_FF_Call("alert(jQuery('#email').val())") // Should return current value for input element with id=email

It does not alert anything and the console logs an _FFReceive: _FFCmd Error

Any ideas on that?

It looks like _FF_Call is actually an _FFCmd with "content.JSWrappedObject." prepended to the string passed to _FF_Call, so I played around with different contexts but could not get an alert with a jquery command inside it to work...

I even started playing with __FFSend, but still could not get it to alert the value...

Confusing...

Thanks!

  • 2 weeks later...
Posted

I want to superimpose a pic from a local img on  an Internet page that I'm visiting.

I tried this code:

_FFCmd("var WCD = window.content.document")

    _FFCmd("var imgX = document.createElement('img');")
    _FFCmd("imgX.setAttribute('src', 'file:///E:\\xxxxxx\\yyyyy.gif');")

    _FFCmd("WCD.getElementsByTagName('div')[3].appendChild(imgX)")

But the img doesn't display.

I tried to save the modified page locally and then reopen it and the img is visible.

I think it's a problem of domain.

How can it be done?

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
  • Recently Browsing   0 members

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