Posts: 7
Threads: 1
Joined: May 2012
Hi, I would think this would be really simple question, but I cannot find the answer anywhere.
How do you use quickmacros to get the URL of a webpage that is open on your screen?
Posts: 12,066
Threads: 140
Joined: Dec 2002
Posts: 7
Threads: 1
Joined: May 2012
Posts: 12,066
Threads: 140
Joined: Dec 2002
Macro
Macro1708
int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804)
Acc a.Find(w "DOCUMENT" "" "" 0x3000)
str URL=a.Value
out URL
Posts: 7
Threads: 1
Joined: May 2012
Posts: 7
Threads: 1
Joined: May 2012
OK... another question here. Is there way to extract the text from that same webpage? However, as in the previous macro, I don't want to have to specify the URL (thus cannot use the method shown here:
Get text from webpage)
I just want to point to the webpage that's already open and have QM recognize that and download the text. I cannot specify the URL because in my situation it is either too long and/or can change in different runs of the macro.
Posts: 12,066
Threads: 140
Joined: Dec 2002
Macro
Macro1710
int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804)
Acc a.Find(w "DOCUMENT" "" "" 0x3000)
str s
a.WebPageProp(0 0 0 s)
out s
Posts: 7
Threads: 1
Joined: May 2012
Posts: 763
Threads: 261
Joined: Jul 2012
Sorry to kick this topic up, but how do you do this in Internet Explorer?
(retrieving the url and extract the text)
Posts: 12,066
Threads: 140
Joined: Dec 2002
Macro
Macro1836
int w=win("Internet Explorer" "IEFrame")
Acc a.Find(w "PANE" "Google" "" 0x3001 2)
str url text
a.WebPageProp(url 0 0 text)
out url
out text
Posts: 763
Threads: 261
Joined: Jul 2012