Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding Text in web page
#4
The first code is for Firefox and IE. QM cannot get text from Chrome like from IE and FF, but can get with select-all-and-copy-to-clipboard.

Code for IE
Macro Macro1727
Code:
Copy      Help
int w=wait(3 WV win("Quick Macros Forum • View topic - Finding Text in web page - Internet Explorer" "IEFrame"))
Acc a.Find(w "PANE" "" "" 0x3001 3)
str s
a.WebPageProp(0 0 0 s)
;out s
if findrx(s "\bHighest Educational\b")>=0
,out 1
else
,out 0

For Chrome
Macro Macro2365
Code:
Copy      Help
int w=wait(3 WV win("Quick Macros Forum • View topic - Finding Text in web page - Google Chrome" "Chrome_WidgetWin_1"))
act w
Acc a.Find(w "DOCUMENT" "" "" 0x3001 3)
a.Select(1)
key Ca
str s.getsel
;out s
if findrx(s "\bHighest Educational\b")>=0
,out 1
else
,out 0

Or can get Chrome page URL and download the page. But it is not very useful because slow, does not work if need to log in etc.
Macro Macro2693
Code:
Copy      Help
int w=wait(3 WV win("Quick Macros Forum • View topic - Finding Text in web page - Google Chrome" "Chrome_WidgetWin_1"))
Acc a.Find(w "DOCUMENT" "" "" 0x3001 3)
str URL
a.WebPageProp(URL)
HtmlDoc d
d.SetOptions(2)
d.InitFromWeb(URL)
str s=d.GetText
;out s
if findrx(s "\bHighest Educational\b")>=0
,out 1
else
,out 0


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)