Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get URL?
#1
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?
#2
what web browser?
#3
Firefox.
#4
Macro Macro1708
Code:
Copy      Help
int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804)
Acc a.Find(w "DOCUMENT" "" "" 0x3000)
str URL=a.Value
out URL
#5
It worked! Thanks.
#6
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.
#7
Macro Macro1710
Code:
Copy      Help
int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804)
Acc a.Find(w "DOCUMENT" "" "" 0x3000)
str s
a.WebPageProp(0 0 0 s)
out s
#8
Perfect! Thank you.
#9
Sorry to kick this topic up, but how do you do this in Internet Explorer?
(retrieving the url and extract the text)
#10
Macro Macro1836
Code:
Copy      Help
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
#11
THANK YOU!!!!!!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)