09-16-2012, 06:50 PM
|
get all text showing on web page
|
|
try this
Code: strPageText=Browser().Page().Object.body.innertextstrPageText is a string which now holds the entire text of the page. Do let me know if you need more help. Regards, Ankesh
09-17-2012, 02:23 PM
(This post was last modified: 09-17-2012, 02:37 PM by daniel_QTP.)
Actually it works, but I get the texts I do not see on the screen.
for example, <input type="hidden" autocomplete="off" name="_fb_noscript" value="true" /> How can I get only the text that I see on the screen? and how I can work with any string and string separately? I mean, I have the ability to reach all the text on the screen separately and not all the text as one group Thank you very much! I tried the following code: Code: strPageText=Browser("Facebook").Page("Facebook").Object.body.innertext
strPageText= Split(strPageText,chr(10))I got an array which is filled with empty values
09-25-2012, 12:44 PM
sample code:
Code: Function GetPageAllStringA(obj)
' to escape invisible object, very difficult
' If lcase(obj.body.style.visibility) = "hidden" or lcase(obj.body.style.display) = "inline-block" Then
' GetPageAllStringA = ""
' Exit Function
' End If
Set objChildren = obj.childNodes
If objChildren.length = 0 Then
GetPageAllStringA = obj.innerText
Exit Function
End If
For i = 0 to objChildren.length - 1
set obj = objChildren.item(i)
GetPageAllStringA = GetPageAllStringA & vbcrlf & obj.innerText
Next
End Function
str = GetPageAllStringA(Browser("Google").Page("Google").Object)
msgbox str |
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| Can QTP handle slick grid table in a web page | qtplearner88 | 2 | 5,241 |
10-01-2019, 10:44 AM Last Post: shilpi952 |
|
| DP Web Browser/Page issues | rstimers | 1 | 2,934 |
08-14-2015, 12:37 PM Last Post: venkatesh9032 |
|
|
|
Capture Entire Web page through QTP | learnQtptips | 2 | 12,581 |
07-25-2013, 05:24 PM Last Post: vinod123 |
| Read text from text file and save it into a variable in qtp | arpan | 3 | 14,120 |
06-19-2013, 08:34 PM Last Post: arpan |
|
| MsgBox not showing | arescool | 4 | 5,121 |
06-13-2013, 03:12 PM Last Post: vinod123 |
|
Users browsing this thread: 1 Guest(s)

