hey...
i tried using 'HTML Element Actions' to 'Get Text' from a fixed frame on Internet Explorer. But everytime i refresh the page and the text changes and when i run the macro it says object not found. How can I make QM take text automatically from a preset frame and use that text as a tring variable? It would be nice if somone can help me out.
Posts: 12,140
Threads: 142
Joined: Dec 2002
Capture element whose tag is BODY. Uncheck Name.
Example with
http://msdn.microsoft.com/library/
Htm el=htm("BODY" "" "" "+IEFrame" "3/2" 0 0x20)
str s=el.Text
ShowText "" s
If you cannot capture BODY element, capture some other element and click < button until you see BODY in Tag field.
This gets whole text from that frame. If you need only some element from it, don't use BODY tag, but instead use this: Capture the element, uncheck Name, check Html, delete part of HTML, leaving only what does not change when you refresh the frame, and replacing deleted parts with *. This should work in many cases.
so once i assin this as a variable str how can i use it to make a If situtation.. can u give me a short example of how to use a string variable as part of a if command
thanks bro
Posts: 12,140
Threads: 142
Joined: Dec 2002
Several examples
if(s="abc") ;;case sensitive
,...
,...
if(s~"abc") ;;case insensitive
,...
,...
if(matchw(s "*abc*")) ;;if contains
,...
,...
sel s
,case "abc"
,...
,...
,case "def"
,...
,...
sel s 1|2 ;;case insensitive, use wildcards
,case "*abc*"
,...
,...
,case "*def*"
,...
(here , are used instead of tabs)
man i still dont understand can u explain it in laymen terms (a bit more simpler lol) ( i am stuck as to how to capture text frm the frame)
well am i still to use the get text frm html element? i just need to get the number frm the frame and proceess it in a if situation thats all.. and then if the condition is met i want to type a number to the other box and press exter (this part is easy)
this is what i get
MSHTML.IHTMLElement el=htm("TD" "4,500 " "" " Internet Explorer" "2" 9 0x21)
str s=el.innerText
Posts: 12,140
Threads: 142
Joined: Dec 2002
MSHTML.IHTMLElement el=htm("TD" "" "*<TD align=right>*</TD>" " Internet Explorer" "2" 21 0x24)
str s=el.innerText
s.findreplace(",")
int i=val(s)
if(i<1000)
,...
,...