Jump to content

FF.au3 (V0.6.0.1b-10)


Stilgar
 Share

Recommended Posts

  • 2 weeks later...
  • 2 weeks later...

Hi,

I'm new to FF.au3.

I downloaded it and copied to to C:\Program Files\AutoIt3\Include\ so that my scripts can find the user defined functions.

Then I copied some examples and executed something like this (and it worked fine):

#include <FF.au3>

$url = "http://www.autoit.de"

If _FFStart($url) Then

_FFFrameEnter(1) ;0-n index

MsgBox(0, "Frame 2 URL", _FFCmd(".location.href"))

_FFFrameLeave()

MsgBox(0, "Top URL", _FFCmd(".location.href"))

EndIf

But when I append this:

If _FFIsConnected() Then

MsgBox(0, "success", "connected")

Else

MsgBox(0, "fail", "failed")

EndIf

I'm getting back failed for _FFIsConnected.

I'm running on Win7 VM, FF14.0. What can I check to see why it's failing to confirm that FF is connected?

Link to comment
Share on other sites

I added MozRepl to my Firefox as it is required to by FF.au3, but I think the connection still will not work.

Read some past posts by LouLou that since FF8 there have been problems connecting to it.

What is the latest stable version of Firefox that FF.au3 can work with? I do not have the option to revert, so I probably have to consider another solution for what I'm doing.

Link to comment
Share on other sites

What is the latest stable version of Firefox that FF.au3 can work with?

I use 14.0.1, successfully. Part of the code you posted works for me (returns "connected"), if I _FFconnect() before I run _FFIsConnected(). Like this:

_FFConnect()
If _FFIsConnected() Then
    MsgBox(0, "success", "connected")
Else
    MsgBox(0, "fail", "failed")
EndIf

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

Link to comment
Share on other sites

  • 2 weeks later...

<Post edited as this section referred to a flame "skirmish" which has now been deleted from the thread>

I have a question. Please excuse my newbie-ness with this. I've only been trying to figure out scripting in the last few weeks. While I can see that the help and examples currently available most likely explain a lot to experienced scripters, there are many things that elude me. I'm trying my best to learn on my own but there are things I just have to ask help with.

I frequently visit picture sites such as 4chan. I'd like to be able to set up a script that can find the links on a page and click them for me as I sometimes miss seeing a few. In the documentation for FF.au3 there's an instruction for clicking links. I believe it is "_FFLinkClick" but as it seems the documentation page is down right now I can not check to make sure. How would I scan the page for links then have the script click them without following links that have already been loaded? I didn't see a setting to ignore followed links in the documentation.

Edited by Melba23
Post edited to remove section
Link to comment
Share on other sites

I am trying to read the message in the status bar to see when a page is loaded.

I cannot use the _FFLoadWait() function, because here the initial loading is over, and other parts of the page load, when it is scrolled horizontally or vertically.

I can see that the status bar in firefox shows the "done" message correctly after each partial loading is over. (yes I enabled the status bar again in the new firefox via an addon even though it was removed)

I am not sure what function to use to get this message. Can someone please help?

Thanks!

Link to comment
Share on other sites

How could I scan an element on a page for for certain text? I tried using the FF frame commands but haven't been able to get it to detect the text I'm looking for. The element I'm trying to scan is "div.padding_content.center" for the text "Success".

Like I stated in my previous post, I'm completely new to this and am trying to figure things out but I don't really even know where to start.

Link to comment
Share on other sites

The more I try to figure this out the more I'm getting lost.... Could someone post some useful links for some information that would help me figure some of this out? Such as where on earth are people getting values for things like this?

#Include <FF.au3>
_FFConnect()
If _FFIsConnected() Then
; href of the current page
$sHref = _FFCmd(".location.href")
If Not @error Then MsgBox(64,"Current href:",$sHref)
_FFOpenURL("http://ff-au3-example.thorsten-willert.de/")
; href from an image link
$sHref = _FFCmd(".images[0].parentNode.href")
If Not @error Then MsgBox(64,"Href of the first image-link:",$sHref)
; title of the current page
$sTitle = _FFCmd( ".title")
If Not @error Then MsgBox(64,"Title of the current page:",$sTitle)
; browser version
$sVersion = _FFCmd("navigator.userAgent")
If Not @error Then MsgBox(64,"Browser version:",$sVersion)
Else
MsgBox(64,"Error:","Can't conncect to FireFox")
EndIf

"images[0].parentNode.href", "location.href"? I'm assuming these are set values, but where could I find a list of them and what they are for? I don't even know where to begin looking. The help available for ff.au3 doesn't give examples or references for many things I need to know. I'm on the verge of just giving up because I have no clue where to look or what to look for. Over 7 hours spent today and I've gotten nowhere.

Edited by Kantanshi
Link to comment
Share on other sites

Thanks to the author of FF.au3 UDF - I've just spent an interesting coffee break playing with some simple FF automation (14.0.1). I've been playing with http://ifttt.com (which provides some cool web-service automation especially via Dropbox) but which is limited to a 15 minute polling period. So I just wanted an automated button presser ("check my ifttt recipes now"). The main problem was working out the best way to connect to a FF window (tab). I ended up with the following:

If _FFConnect(Default, Default, 3000) Then

; do work including _FFLinkClick

Else

MsgBox(0, "Connect", "failed to connect; will force a start next, then try again")

If _FFStart("about:blank") Then

MsgBox(0, "_FFStart", "started")

Else

MsgBox(0, "_FFStart", "failed")

EndIf

EndIf

_FFConnect doesn't always work and if it doesn't best to do a _FFStart

The problem with _FFStart is :- (I always have FF open)

1. it opens a new tab (window) with URL 4242 (I know that's the port number!)

2. when that fails a totally new FF window opens

So I then manually close the new window and set the focus to the "4242" tab and re-run and it works fine.

Link to comment
Share on other sites

Hey,

is there any way, that you update it again^^?

I think, there is an error again, with the communication between MozRepl and the Script/the FF?!...

If I use

#include

_FFStart("http://de.wikipedia.org/wiki/Wikipedia:Hauptseite", "default", 1, False)

, he starts the FF two times... One with the site and one with "4242" as URL...

Get errors with all scripts using the FF.au3... :/

I downloaded the newest MozRepl and FF:au3.

And I have the newest FF (http://www.mozilla.org/en-US/firefox/update/ -> up2date, 14.0.1)!

MozRepl is started...

Any ideas?!^^

Best regards,

Aca

*EDIT*

OK, #389 should work here... xD

Edited by Acanis
Link to comment
Share on other sites

@musicrab - that 4242 tab is because of an error, fixed by cramaboule in post #389.

Thanks for the prompt - I didn't look far enough back!

I'm doing something wrong. With the fix _FFStart is now timing out I think (when it calls _FFConnect) IE

_FFConnect ==> Timeout: TCPConnect Error: 10061

Do I have to change mozrepl ports (and if so, how). Many thanks guys.

Link to comment
Share on other sites

  • 1 month later...

Here's an updated version of FF.au3, containing changes that I have applied to v0.6.0.1b-7.

For tracking purposes, I've labeled it v0.6.0.1b-8. I am not the original author, nor am I the maintainer of this code base. This is just the current version of FF.au3 that I use for my own scripts. It works for me, but YMMV. Use at your own risk. ;-)

Dan

FF V0.6.0.1b-8.au3

Link to comment
Share on other sites

@DanP2, I've used _FFGetPosition where I couldn't get any other method to click a button. Hope this helps.

$elem = "window.content.wrappedJSObject.top.document.getElementsByName('ok')[0]"
$posarr = _FFGetPosition($elem)
AutoItSetOption("MouseCoordMode", 2)
$x1 = $posarr[0] + $posarr[2] + 40
$y1 = $posarr[1] + $posarr[3] + 10
MouseMove($x1, $y1, 1)

Thanks for updated FF.au3, I'll download it when I next work on FF prog.

Link to comment
Share on other sites

  • 3 weeks later...

Someone know how to click on an input:file with FF.au3?

This is my input.

<input name="upfile[]" id="file1" multiple="multiple" type="file">

I tried this.

_FFClick("file1", "id") ; It doesn't work!!!

Thanks for the updated FF.au3, DanP2.

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

  • Recently Browsing   0 members

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