1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Stilgar

Beiträge von Stilgar

  • Aktienwert in einem Fenster darstellen

    • Stilgar
    • 16. Februar 2009 um 11:24

    Geht nun etwas "einfacher", ohne den Quelltext anzugsehen:

    Mit der neuesten Version der FF.au3 ist folgendes möglich:

    [autoit]

    MsgBox(64,"",_FFGetValueByXPath($Socket, "//td[@class='arrow0' and position()=1]", "string", 1))

    [/autoit]


    :D

    Das muß man sich allerdings nicht selber ausdenken, sondern kann das FF-Addon XPather verwenden:
    Einfach das gewünschte Element markieren (die Zahl), im Context Menü XPather aufrufen und aus dem Ergebnis den letzten Abschnitt verwenden (siehe Bild) und in den obigen Befehl einsetzen, allerdings mit zwei führenden //

    Wenn allerdings dort nur ein "Pad" steht, muß man eben probieren wie weit man diesen kürzen kann, damit das Ergebnis noch eindeutig ist.

  • jEdit für AutoIt

    • Stilgar
    • 16. Februar 2009 um 11:12

    Hoppla, mit der neuesten Version des Edit-Modes, hatte ich die Debug-Macros unbrauchbar gemacht.

    Dort gibt's ein Update:
    http://jedit4autoit.thorsten-willert.de/

    Eine Anpassung (Edit-Mode, Xinsert, Clipper ...) an einzelne UDFs werde ich nicht mehr machen, dafür gibts ja das Macro "Update UDFs" in Verbindung mit "jEdit4AutoIt_UDF_Updater.au3" :)

    Grüße
    Stilgar

  • FF.au3 Beta (Programm und Dokumentation)

    • Stilgar
    • 16. Februar 2009 um 10:54

    Update auf V0.3.6.1: (die Dokumentation ist noch nicht ganz angepaßt, die neuen Funktionen sind allerdings schon drin)

    - New: _FFTableGetCell(ByRef $Socket, $vTable, $iColumn, $iRow[, $sMode = "index"[, $sReturnMode = "text"[, $bCompress = true]]])
    Gets the text or HTML of a table cell.
    - New: _FFGetValueByXPath(ByRef $Socket, $sQuery[, $sReturnType = "string"[, $iFilter = 1]])
    Returns value from a XPath query
    - Changed: $_FF_COM_TRACE is now a var instead of const, e.g. for many communication you can use
    If Not @COMPILED Then $_FF_COM_TRACE = False
    when the script is running in an editor.
    - Fixed: _FFGetLength, error when $sMode was an empty string

    V0.3.6.0:
    - Added: _FFFormSubmit now with $bLoadWait parameter, default = true
    - Changed: _FFGetValueById now sets error $_FF_ERROR_NoMatch if "id" is not found
    - Changed: _FFGetValueByName now sets error $_FF_ERROR_NoMatch if "name" is not found
    - Changed: _FFSetValueById now returns now 1 by success, otherwise 0, added parameters checks
    - Changed: _FFSetValueByName now returns now 1 by success, otherwise 0, added parameters checks
    - Changed: _FFLinksGetAll now returns an array with infomations of all links
    - Changed: Now WinTitleMatchMode is only changed in the internal function __FFConnect
    - Removed some parameter checks in internal-functions
    - Optimized all JavaScripts

    V0.3.5.9:
    - Removed error message on the first connection
    - Removed FF-status messages form _FFLoadWait
    - browser version now only checked on the first connection
    - optimized communication speed
    - changed FF_AutoItScript.SimulateClick to click on X/Y coordinates
    - changed _FFFrameEnter now returns the name or index depending
    on the mode

    V0.3.5.8:
    RENAMED SOME FUNKTIONS! I have some wrappers build in, but I removed
    them in the future:
    - _FFGetLinks => _FFLinksGetAll
    - _FFTabSelect => _FFTabSetSelected
    - _FFTabSelected => _FFTabGetSelected
    - _FFTabLength => _FFTabGetLength

    V0.3.5.7:
    * NEW: _FFTabDuplicate(ByRef $Socket[, $vTab = -1[, $sMode = "index"[, $bToFront = false]]])
    * CHANGED: _FFTabClose, complete new, now returns 1 on success otherwise 0
    * UPDATED: _FFTabCloseAll

    V0.3.5.6:
    * NEW: _FFLoadWait: Added Default keyword for $iDelay and $iTimeOut
    * NEW: _FFGetLength: Added "tables"
    * CHANGED!!!: _FFAction: replaced all "true" and "false" strings with boolean true / false
    * CHANGED: _FFFormReset now returns 1 on success otherwise 0
    * CHANGED: _FFFormCheckBox, now returns -1 on error
    * CHANGED: _FFGetLinks, removed the parameter "length"
    if @error the return value is now -1
    Use instead: _FFGetLength()
    * OPTIMIZED: _FFClick

    Viel Spaß damit,

    Grüße
    Stilgar

  • Aktienwert in einem Fenster darstellen

    • Stilgar
    • 15. Februar 2009 um 21:54

    Die Seite hat leider 15 verschachtelte Tabellen - etwas mühselig da im Quelltext zu suchen.

    Als grobe einfache Lösung:

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    #include <FF.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Socket = _FFConnect()
    For $i = 0 To _FFGetLength($Socket,"tables")-1
    $aTabelle = _FFTableWriteToArray($Socket,$i)
    _ArrayDisplay($aTabelle,"Tabelle Nr: " & $i)
    Next

    [/autoit]

    und dann eben suchen wo es drin steht.

  • Aktienwert in einem Fenster darstellen

    • Stilgar
    • 14. Februar 2009 um 23:34

    Bitte.
    Ich mal in die Testversion der FF.au3 eine neue Funktion rein, mit der man einzelne Tabellen-Zellen direkt abfragen kann.
    http://www.thorsten-willert.de/Themen/AutoIt-…tversion/FF.au3

    Sieht dann so aus:

    [autoit]

    $sPreis = _FFTableGetCell($Socket,8,0,1)

    [/autoit]


    Liefert also den Wert aus der Tabelle 8, Reihe 0, Zeile 1 zurück.

  • Neue Funktionen und ToDo-List

    • Stilgar
    • 14. Februar 2009 um 23:20

    Ein Thema im Forum hat mich auf Idee gebracht, für eine Funktion, die nur eine Zelle einer Tabelle ausließt - hier ist sie:

    Spoiler anzeigen
    [autoit]

    ; #FUNCTION# ===================================================================
    ; Name ..........: _FFTableGetCell
    ; Description ...: Gets the text or HTML of a table cell
    ; AutoIt Version : V3.3.0.0
    ; Syntax ........: _FFTableGetCell(ByRef $Socket, $vTable, $iColumn, $iRow[, $sMode = "index"[, $sReturnMode = "text"[, $bCompress = true]]])
    ; Parameter(s): .: $Socket - TCP Socket
    ; $vTable - index (0-n), name
    ; $iColumn - Column (0-n)
    ; $iRow - Row (0-n)
    ; $sMode - Optional: (Default = "index") : index (0-n), name, id
    ; $sReturnMode - Optional: (Default = "text") : text, html
    ; $bCompress - Optional: (Default = true) : Removes double withespaces
    ; Return Value ..: Success - Text or HTML
    ; Failure - 0
    ; @ERROR -
    ; Author(s) .....: Thorsten Willert
    ; Date ..........: Sat Feb 14 23:00:56 CET 2009
    ; Related .......: _FFTableWriteToArray
    ; Example .......: Yes
    ; ==============================================================================
    Func _FFTableGetCell(ByRef $Socket, $vTable, $iColumn, $iRow, $sMode = "index", $sReturnMode = "text", $bCompress = true)
    If Not __FFIsSocket($Socket) Then
    SetError(__FFError("_FFTableGetCell", $_FF_ERROR_SocketError, $Socket))
    Return 0
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $sMode = Default Then $sMode = "index"

    [/autoit] [autoit][/autoit] [autoit]

    If Not IsInt($vTable) And $sMode = "index" Then
    SetError(__FFError("_FFTableGetCell", $_FF_ERROR_InvalidDataType, $vTable))
    Return 0
    EndIf
    If Not IsInt($iColumn) Then
    SetError(__FFError("_FFTableGetCell", $_FF_ERROR_InvalidDataType, $iColumn))
    Return 0
    EndIf
    If Not IsInt($iRow) Then
    SetError(__FFError("_FFTableGetCell", $_FF_ERROR_InvalidDataType, $iRow))
    Return 0
    EndIf
    Switch StringLower($sReturnMode)
    Case "text"
    $sReturnMode = "textContent"
    Case "html"
    $sReturnMode = "innerHTML"
    Case Else
    SetError(__FFError("_FFTableGetCell", $_FF_ERROR_InvalidValue, "$sReturnMode: " & $sReturnMode))
    Return 0
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    Local $sObject = "content.document"

    [/autoit] [autoit][/autoit] [autoit]

    Switch StringLower($sMode)
    Case "index"
    $sObject &= ".getElementsByTagName('tbody')[" & $vTable & "]"
    Case "name"
    ContinueCase
    Case "id"
    $sObject &= ".getElementsByTagName('tbody')['" & $vTable & "']"
    Case Else
    SetError(__FFError("_FFTableGetCell", $_FF_ERROR_InvalidValue, "$sMode: " & $sMode))
    Return 0
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    Local $sRndErr = "_FFTableGetCell_Err:" & Random(10000,99999,1)
    Local $sElements = StringFormat("getElementsByTagName('tr')[%i].getElementsByTagName('td')[%i]",$iRow,$iColumn)
    Local $sCommand = StringFormat("try{with(%s){(%s != null ? %s.%s : '%s')}}catch(e){'%s';};",$sObject,$sElements,$sElements,$sReturnMode,$sRndErr,$sRndErr)

    [/autoit] [autoit][/autoit] [autoit]

    Local $sRetVal = _FFSetGet($Socket,$sCommand)
    If $sRndErr <> $sRetVal Then
    If $bCompress Then Return StringRegExpReplace($sRetVal, "[\s]+", " ")
    Return $sRetVal
    Else
    SetError(__FFError("_FFTableGetCell", $_FF_ERROR_NoMatch, "Table/Column/Row: " & $vTable & "/" & $iColumn & "/" & $iRow))
    Return 0
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==> _FFTableGetCell

    [/autoit]


    :P hoffentlich muß ich das nicht erklären :D

    Die ist auch schon in der aktuellen Testversion drin.

    Viel Spaß damit!

  • Aktienwert in einem Fenster darstellen

    • Stilgar
    • 14. Februar 2009 um 21:59

    anno2008:
    Was soll das denn heisen? :D

    Wenn eh schon FF im Einsatz ist, wäre die Tabelle auslesen in dem Fall:

    [autoit]

    $aTabelle = _FFTableWriteToArray($Socket,8)
    msgbox(64,"Rücknahmepreis:",$aTabelle[0][1])

    [/autoit]

    Schneller wäre allerdings:

    [autoit]

    $sPreis = _FFSetGet($Socket,".getElementsByTagName('tbody')[8].getElementsByTagName('tr')[1].getElementsByTagName('td')[0].textContent")

    [/autoit]


    :P

  • Neue Funktionen und ToDo-List

    • Stilgar
    • 14. Februar 2009 um 17:54

    Nächster Test V0.3.6.0:

    http://www.thorsten-willert.de/Themen/AutoIt-…tversion/FF.au3

    Hauptsächlich Optimierungen und einige Funktionen nun mit eindeutigen Return Values:

    - Added: _FFFormSubmit now with $bLoadWait parameter, default = true
    - Changed: _FFGetValueById now sets error $_FF_ERROR_NoMatch if "id" is not found
    - Changed: _FFGetValueByName now sets error $_FF_ERROR_NoMatch if "name" is not found
    - Changed: _FFSetValueById now returns now 1 by success, otherwise 0, added parameters checks
    - Changed: _FFSetValueByName now returns now 1 by success, otherwise 0, added parameters checks
    - Changed: _FFLinksGetAll now returns an array with infomations of all links
    - Changed: Now WinTitleMatchMode is only changed in the internal function __FFConnect
    - Removed some parameter checks in internal-functions
    - Optimized all JavaScripts

    Komplettumbau von _FFGetLinks: gibt nun Array mit (fast) allen Informationen über alle Links zurück und heist in Zukunft:
    _FFLinksGetAll:

    Spoiler anzeigen
    [autoit]

    ; #FUNCTION# ===================================================================
    ; Name ..........: _FFLinksGetAll
    ; Description ...: Get informations of all links
    ; AutoIt Version : V3.3.0.0
    ; Syntax ........: _FFLinksGetAll(ByRef $Socket)
    ; Parameter(s): .: $Socket - TCP socket to FireFox
    ; Return Value ..: Success - 2 dim array with the link informations:
    ; - array[n][0] = href
    ; - array[n][1] = hash
    ; - array[n][2] = search
    ; - array[n][3] = name
    ; - array[n][4] = id
    ; - array[n][5] = text
    ; - array[n][6] = innerHTML
    ; - array[n][7] = target
    ; - array[n][8] = protocol
    ; - array[n][9] = port
    ; Failure - Array[0][0] = -1
    ; @ERROR -
    ; Author(s) .....: Thorsten Willert
    ; Modified ......: Sat Jan 24 21:35:27 CET 2009
    ; Example .......: Yes
    ; ==============================================================================

    [/autoit]

    Grüße Stilgar

  • Auf Kriegsfuß mit den Regular Expressions

    • Stilgar
    • 12. Februar 2009 um 17:12

    Mit Java kommt man da auch nicht weiter, eher mit HTML / JavaScript und dem DOM :P
    Man sollte sich schon ein bischen mit dem auskennen was man analyisert ;)

    [EDIT]
    Steht doch fast alles dort:
    http://de.selfhtml.org/javascript/objekte/index.htm

  • Auf Kriegsfuß mit den Regular Expressions

    • Stilgar
    • 12. Februar 2009 um 17:09

    Warum denn nicht gleich so:

    [autoit]

    _FFSetGet($Socket,".getElementById('konstant').childNodes[0].color")

    [/autoit]
  • Neue Funktionen und ToDo-List

    • Stilgar
    • 12. Februar 2009 um 14:17

    Mal wieder was zum Testen V0.3.5.9:

    http://www.thorsten-willert.de/Themen/AutoIt-…tversion/FF.au3

    Änderungen seit V0.3.5.6:
    V0.3.5.9:
    - Removed error message on the first connection
    - Removed FF-status messages form _FFLoadWait
    - browser version now only checked on the first connection
    - optimized communication speed
    - changed FF_AutoItScript.SimulateClick to click on X/Y coordinates
    - changed _FFFrameEnter now returns the name or index depending
    on the mode

    V0.3.5.8:
    RENAMED SOME FUNKTIONS! I have build in some wrappers, but I removed
    them in the future:
    - _FFGetLinks => _FFLinksGetAll
    - _FFTabSelect => _FFTabSetSelected
    - _FFTabSelected => _FFTabGetSelected
    - _FFTabLength => _FFTabGetLength

    V0.3.5.7:
    * NEW: _FFTabDuplicate(ByRef $Socket[, $vTab = -1[, $sMode = "index"[, $bToFront = false]]])
    * CHANGED: _FFTabClose, complete new, now returns 1 on success otherwise 0
    * UPDATED: _FFTabCloseAll

    Viel Spaß beim Ausprobieren!

  • Kompliziert - "Multi Threading"

    • Stilgar
    • 12. Februar 2009 um 14:12

    Wie sieht es denn mittlerweile aus?

  • XSL Quelltext auslesen

    • Stilgar
    • 12. Februar 2009 um 14:10

    Auch gut.

    Die While-Schleife könntest du allerdings durch ein For To Next ersetzen, also:

    For $i = 0 To 9
    ....code....
    Next

    ist übersichtlicher.

  • XSL Quelltext auslesen

    • Stilgar
    • 12. Februar 2009 um 13:02

    Hat das überhaupt so funktioniert?

    So weit mal wie ich es ausprobieren kann:

    Spoiler anzeigen
    [autoit]

    #region Includes
    #include <FF.au3>
    #endregion Includes
    $Socket = _FFStart("http://www.gwars.de/index.php?PAGE=LoginPage",default,1)

    [/autoit] [autoit][/autoit] [autoit]

    If $Socket > -1 Then
    _FFSetValueByName($Socket,"NAME","********")
    _FFSetValueByName($Socket,"SECRET","********")
    _FFFormSubmit($Socket)
    _FFLoadWait($Socket)
    _FFTabCloseAll($Socket)
    If _FFFrameEnter($Socket, 'GWARS_HAUPTFRAME','name') Then
    $sHTML = _FFReadHTML($Socket,true)
    $file = FileOpen("config.ini", 1)
    If $file = -1 Then
    MsgBox(0, "Fehler", "Kann Datei nicht öffnen")
    Exit
    EndIf
    FileWrite($file, $sHTML)
    Sleep(3000)
    _FFFrameLeave($Socket)
    EndIf
    EndIf

    [/autoit]

    Wenn nur ein Formular auf der Seite ist reicht einfach _FFFormSubmit($Socket) um es abzusenden.
    Dann sollte man noch warten bis die Seite geladen ist _FFLoadWait.
    Um mit _FFFrameEnter einen Frame mit Namen anzusprechen muß man das der Funktion auch sagen, ansonsten sucht sie nach dem Index, also _FFFrameEnter($socket,"DerFrameName","name")
    Das kann man auch gleich überprüfen wenn man den Befehl mit If abfrägt.

    Weiter kann ich es nicht testen.

  • XSL Quelltext auslesen

    • Stilgar
    • 12. Februar 2009 um 12:34

    Das Programm kann ich nun leider nicht nachvollziehen, da ich mich ja nicht anmelden kann ...

    Du startest FF also mit einer Seite, die normalerweise ein PopUp-Fenster ist, schickst das Formular ab und was passiert dann? Nicht im Programm - auf der Seite?

  • FireFox Addons fernsteuern

    • Stilgar
    • 11. Februar 2009 um 17:07

    Fox!Box:

    Spoiler anzeigen
    [autoit]

    #region Includes
    #include <FF.au3>
    #include "_FF_FoxBox.au3"
    #endregion Includes

    [/autoit] [autoit][/autoit] [autoit]

    _FFConnect()

    [/autoit] [autoit][/autoit] [autoit]

    If _FFIsConnected() Then
    $sIP = _FF_FoxBox_GetIP()
    MsgBox(64,"External IP",$sIP)
    $sIP2 = _FF_FoxBox_Reconnect()
    MsgBox(64,"Your new external IP","New: " & $sIP & @crlf & "Old: " & $sIP )
    MsgBox(64,"","Toggling Fox!Box status ...")
    _FF_FoxBox_ToggleStatus()
    MsgBox(64,"","Fox!Box status is now: " & @crlf & _FF_FoxBox_GetStatus())
    _FF_FoxBox_ToggleStatus()
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Exit

    [/autoit]

    _FF_FoxBox.au3

    Enthaltene Funktionen:
    _FF_FoxBox_GetIP:
    Liefert die externe IP
    _FF_FoxBox_GetStatus:
    Status von Anzeige aktualisieren
    _FF_FoxBox_Reconnect:
    Neu verbinden
    _FF_FoxBox_ToggleStatus:
    Togglen von Anzeige aktualisieren

  • Fire Fm

    • Stilgar
    • 11. Februar 2009 um 12:12

    Dankeschön :) :) :)

    Ich habe es nochmal überarbeitet.
    https://autoit.de/index.php?page…76123#post76123
    Änderungen stehen unten.

  • Fire Fm

    • Stilgar
    • 10. Februar 2009 um 21:08

    Das war auch nur eine Funktions-Demo. $Socket > -1 überprüft ob nach dem $Socket = _FFConnect eine Verbindung zu stande kam. Klar kommt dann irgendwann exit - steht ja auch im Programm :D

    Title? Autor? Was denn noch alles? :)

    [EDIT]
    Funktion für Title Information
    https://autoit.de/index.php?page…76123#post76123

  • Fire Fm

    • Stilgar
    • 10. Februar 2009 um 18:12

    Die aktuelle Version 3.x und MozRepl:
    http://hyperstruct.net/content/mozrepl

  • Variablen Problem

    • Stilgar
    • 10. Februar 2009 um 17:49

    Am besten mit StringFormat:

    [autoit]

    For $i = 0 To 10
    ConsoleWrite( StringFormat("%03s",$i) & @crlf)
    Next

    [/autoit]

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™