Posts: 4
Threads: 2
Joined: Oct 2015
(Longtime fan with l-o-n-g lapses between uses here.) I am trying to extract links from a list that changes regularly.
Using Find accessible object, I can see this:
- LIST ""
- LISTITEM ""
- div ""
+ LINK "announce" "https://admin-xxx.com/announce/...
|- STATICTEXT "announce"
+ LINK "biz" "https://admin-xxx.com/biz/...
|- STATICTEXT "biz"
However, I cannot figure out how to grab the links, then traverse the list.
Posts: 12,074
Threads: 141
Joined: Dec 2002
Find common parent object, then call GetChildObjects.
Macro
Macro2734
int w=wait(3 WV win("Quick Macros Forum • View topic - Extract links from web list - Mozilla Firefox" "MozillaWindowClass"))
Acc a.FindFF(w "UL" "" "class=linklist rightside" 0x1004 3)
ARRAY(Acc) b
a.GetChildObjects(b 1 "LINK")
int i
for i 0 b.len
,str url=b[i].Value
,out url
,
Posts: 4
Threads: 2
Joined: Oct 2015
Thanks for the quick and helpful response!
I get:
failed to get object. If using portable Firefox, look here. I am not running Portable Firefox.
Running:
- Win7
Firefox as Admin
QM as Admin
Note: When I change findFF to Find I get a list of all the links on the page. Unfortunately, the page is full of unnamed lists I do not want.
Should I punch a hole through my firewall for QM?
Posts: 12,074
Threads: 141
Joined: Dec 2002
When impossible to identify an object, use the Navigate feature.
In dialog "Find accessible object" capture some other object that can be identified (has a name etc) and found. It should be near the object that you actually need (look in the tree view below). Click Test to ensure that it will be found.
Then in the tree view look how these two objects are related. Then use the ... button by the Navigate field. Add Next, Parent etc. Always click Test. Until it will find the object that you actually need. OK.
Accessible object functions don't use the internet and firewall.
Another option - use class HtmlDoc. It can download web page, or use a HTML element object from Internet Explorer.