Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
extract links (a href => zip only)
#9
Is this still working for the last version of QM?


Gintaras Wrote:Faster version.

Function FirefoxGetLinks
Code:
Copy      Help
;/
function hwnd [ARRAY(str)&aURL] [ARRAY(str)&aText] [ARRAY(Acc)&aObj]

;Gets links in Firefox.

;hwnd - Firefox window handle.
;aURL - receives href attribute of links. It is full URL, not relative as in HTML source. Can be 0 if you dont need it.
;aText - receives text of links. Can be 0 if you dont need it.
;aObj - receives accessible object of links. Can be 0 if you dont need it.

;EXAMPLE
;out
;int w=win("Firefox" "Mozilla*WindowClass" "" 0x804)
;ARRAY(str) a at; int i
;FirefoxGetLinks w a at
;for i 0 a.len
,;out F"{at[i]%%-35s} {a[i]}"


if(&aURL) aURL=0
if(&aText) aText=0
if(&aObj) aObj=0

FFNode f.FindFF(hwnd "A" "" "" 0 0 0 &__FGL_Proc &hwnd)

err+ end _error
Function __FGL_Proc
Code:
Copy      Help
;/
function# FFNode&x level *p FFNODEINFO&ni

ARRAY(str)& aURL=+p[1]
ARRAY(str)& aText=+p[2]
ARRAY(Acc)& aObj=+p[3]

Acc a.FromFFNode(x)

_s=a.Value
if(!_s.len) ret 1

if(&aURL) aURL[]=_s
if(&aText) aText[]=a.Name
if(&aObj) aObj[]=a

err+
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)