Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to take a text from a frame in the internet explorer
#1
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.
#2
Capture element whose tag is BODY. Uncheck Name.

Example with http://msdn.microsoft.com/library/

Code:
Copy      Help
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.
#3
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
#4
Several examples

Code:
Copy      Help
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)
#5
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
#6
this is my lastest effort... note-390 is the part that i do not need.. can u tell me the alterations i need to do to get the desird result

Code:
Copy      Help
MSHTML.IHTMLElement el=htm("TD" "" "[]<TD align=right>390&nbsp;</TD>" " Internet Explorer" "2" 21 0x24)
str s=el.innerText
#7
Code:
Copy      Help
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)
,...
,...


Forum Jump:


Users browsing this thread: 1 Guest(s)