05-20-2020, 11:49 AM
Sorry one more question.
Using your example I was able to extract all divs which have a classname that begins with "row\s" (regx, 'row' followed by a space).
Macro Macro101
Then in the subfunction I used
Macro Macro101
It results in multiple HTML blocks beeing extracted:
QUESTION:
1)
What is the best method to extract:
https://thumb.png
FROM: div class = "icn"
EXTRACT: IMG src
(I marked it above in the code with arrow: <============== )
2)
What is the best method to extract:
some title
FROM: div class = "title" ,
EXTRACT: the innertext from the <A href' which is within div class = "title"
(I marked it above in the code with arrow: <============== )
What I would attempt to use is
Macro Macro101
But I do not know what best approach / proper approach is.
Maybe I am using incorrect / cpu resource waisting method (?)
Using your example I was able to extract all divs which have a classname that begins with "row\s" (regx, 'row' followed by a space).
Macro Macro101
int w=wait(3 WV win("Mozilla Firefox" "MozillaWindowClass"))
FFNode doc.FromDoc(w)
doc.FindFF(doc "div" "" "class=^row\s" 8 0 0 &sub.Callback_FindFF)Then in the subfunction I used
Macro Macro101
It results in multiple HTML blocks beeing extracted:
<DIV class=icn>
<A class=fulllink href="https://www.TEST.com/" target=_blank>
<IMG src="https://thumb.png"> <================================================= get 'https://thumb.png'
</A>
</DIV>
<DIV class=gameinfo>
<DIV class=title>
<A href="https://TEST.com/" target=_blank>some title</A> <================================================= get 'some title' (inner text)
<DIV class=js-subproduct-admin-edit data-machine-name="qm_studio" data-entity-kind="subproduct"></DIV>
</DIV>
<DIV class=subtitle>
<A href="https://www.syntystudios.com/" target=_blank>QM Studios</A>
</DIV>
</DIV>QUESTION:
1)
What is the best method to extract:
https://thumb.png
FROM: div class = "icn"
EXTRACT: IMG src
(I marked it above in the code with arrow: <============== )
2)
What is the best method to extract:
some title
FROM: div class = "title" ,
EXTRACT: the innertext from the <A href' which is within div class = "title"
(I marked it above in the code with arrow: <============== )
What I would attempt to use is
Macro Macro101
int i
HtmlDoc d.InitFromText(outerHTML)
ARRAY(MSHTML.IHTMLElement) extract_el_arr
d.GetHtmlElements(extract_el_arr "A" "")
for i 0 extract_el_arr.len
,_s=extract_el_arr[i].className
,if(_s=....)
,,....But I do not know what best approach / proper approach is.
Maybe I am using incorrect / cpu resource waisting method (?)
