-
March 25th, 2009, 03:57 PM
#1
[RESOLVED] WebBrowser.DocumentText
Is there a limit of characters for DocumentText of the WebBrowser control? When I try to copy it to the clipboard, it is always truncated. Any way around this problem?
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
March 25th, 2009, 06:16 PM
#2
Re: WebBrowser.DocumentText
I've been trying to learn more about the WebBrowser control lately.
Not an expert at all, but I found a couple links that seem to apply.
I did read that there is a limit based upon memory, and clipboard.
It could be a script preventing it. Same one blocking popups maybe.
sotoasty, posted a similar question here:
http://www.codeguru.com/forum/showthread.php?t=423580
Maybe design mode:
http://social.msdn.microsoft.com/For...-6c3bdc5df0cc/
http://social.msdn.microsoft.com/For...-ac6ff1281506/
You could check by shortening what is to be copied, just as a test.
Then you'll know if it's a memory/clipboard limitation or not.
Dial it in to the right size, and you'll know exactly what the limit is, if any.
Last edited by TT(n); March 25th, 2009 at 06:40 PM.
Reason: link
-
March 25th, 2009, 07:02 PM
#3
Re: WebBrowser.DocumentText
is this what you are doing
Clipboard.SetDataObject(WebBrowser1.DocumentText, True)
-
March 25th, 2009, 08:46 PM
#4
Re: WebBrowser.DocumentText
What version of IE is installed? There are differences in controls as well.
-
March 26th, 2009, 07:48 AM
#5
Re: WebBrowser.DocumentText
Originally Posted by TT(n)
It could be a script preventing it. Same one blocking popups maybe.
Well, there is no script blocking popups. If you are referring to my other thread...you can see that the issue was that popups where opened in a separate IE instance. This would cause the session data to not be seen. Therefore the server-side would not initiate the data I wanted to see.
Just so you know...This text-replace implementation is to replace the popup code and make them open in the same window.
Originally Posted by TT(n)
Then you'll know if it's a memory/clipboard limitation or not.
It's for sure not the clipboard because even just outputting it from my project, no clipboard involved, it gives the truncated version.
I don't see why memory would be the cause here, because there is more than sufficient for this ~40k document.
Originally Posted by Oblio
is this what you are doing
Clipboard.SetDataObject(WebBrowser1.DocumentText, True)
No. I was just using Clipboard.SetText(web.DocumentText). Doesn't matter. Either way it's truncated before the clipboard is even invoked.
Originally Posted by dglienna
What version of IE is installed? There are differences in controls as well.
Internet Explorer 7. There is no reason why IE7 should be having a problem here.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
March 26th, 2009, 07:39 PM
#6
Re: WebBrowser.DocumentText
I went thru another situation involving IE7. My VB6 program worked on three machines, until client bought Vista laptop. All of a sudden, the vb app was timing out after about two minutes, instead of taking 5 minutes.
It wasn't until we installed IE7 that both the compiled app, and in the IDE now failed.
Finally made the connection, and looked it up. The default timeout was changed from ie5 to ie6 and then ie7. Registry hack fixed things.
Found this, though:
http://msdn.microsoft.com/en-us/libr...73(VS.85).aspx
-
March 27th, 2009, 07:18 AM
#7
Re: WebBrowser.DocumentText
Sorry David, but none of that has anything to do with my problem. I'm using VB.NET IE7, and the problem is before I even invoke the clipboard.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
March 27th, 2009, 07:02 PM
#8
Re: WebBrowser.DocumentText
No. I was just using Clipboard.SetText(web.DocumentText). Doesn't matter. Either way it's truncated before the clipboard is even invoked.
Try saving it as an object or picture, even. I'm thinking EOF characters. It isn't XML, is it?
-
March 28th, 2009, 01:29 PM
#9
Re: WebBrowser.DocumentText
No, it's not XML. However, it actually seems as though DocumentText has a character limit. If I just set it to write to a text file, it still is truncated.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
March 28th, 2009, 04:00 PM
#10
Re: WebBrowser.DocumentText
Whereby an IMAGE wouldn't have the same limit...
-
March 28th, 2009, 05:03 PM
#11
Re: WebBrowser.DocumentText
But, an image would defeat the purpose. I need the webpage's full functionality. But, I am trying to change some text within it.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
March 28th, 2009, 05:08 PM
#12
Re: WebBrowser.DocumentText
Can't you convert it back into text? It *should* be shorter, as well, when you display it in the browser.
-
March 29th, 2009, 06:58 AM
#13
Re: WebBrowser.DocumentText
I think you're missing the point. I need the pages full functionality. That includes JavaScript and forms. There is no way to go from a screenshot back to the complete original code including scripts and forms.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
March 29th, 2009, 12:01 PM
#14
Re: WebBrowser.DocumentText
There are converters out there, but I've never used them, so I don't know if it would work like that.
When it gets tructated, have you counted the characters remaining?
That may be a clue, that will help in the search for a documented limitation.
I tried a few test runs, and I couldn't reproduce the problem.
If you can give me a number(limit), then I can test it, by trying a larger number of characters here.
A partial diagnosis can be made.
If we match, then it's a control limitation, if not, then the limitation is local to your machine, for whatever reason.
-
March 30th, 2009, 08:43 AM
#15
Re: WebBrowser.DocumentText
Problem has been solved.
I was doing a dumb thing. I just realized that I was trying to evaluate the DocumentText property when the title changed, not when the document was completed.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|