Document's HTML source with WebBrowser control?
Author |
Message |
Olli Ihamak #1 / 12
|
 Document's HTML source with WebBrowser control?
Hello, How can I get current document's HTML source code to some string variable with WebBrowser control? Also, is there way to get document's text to some string variable? I use Visual Basic 6. Thank you for answers!
|
Thu, 26 Feb 2004 23:52:13 GMT |
|
 |
Root #2 / 12
|
 Document's HTML source with WebBrowser control?
Quote: > How can I get current document's HTML source code to some string variable
Here's how to do it without the WebBrowser control: http://groups.google.com/groups?oi=djq&selm=an_606879968
|
Fri, 27 Feb 2004 04:58:03 GMT |
|
 |
Olli Ihamak #3 / 12
|
 Document's HTML source with WebBrowser control?
Quote: > > How can I get current document's HTML source code to some string variable > Here's how to do it without the WebBrowser control: > http://groups.google.com/groups?oi=djq&selm=an_606879968
Thank you for your answer. Unfortunately, that won't work in my case. There is HTML form what I need to fill and post, and then retrieve receive result document's HTML code, so, there is no exact URL.. Filling and posting form with WebBrowser control is easy, but I have not yet found way to get documen't source...
|
Fri, 27 Feb 2004 05:28:58 GMT |
|
 |
Root #4 / 12
|
 Document's HTML source with WebBrowser control?
Quote: > Thank you for your answer. Unfortunately, that won't work in my case. There > is HTML form what I need to fill and post, and then retrieve receive result > document's HTML code, so, there is no exact URL..
Can the results be opened in a new window with a normal web browser? If so, you may be able to get it's "results URL" from there and then use it in your app...
|
Fri, 27 Feb 2004 05:47:44 GMT |
|
 |
Olli Ihamak #5 / 12
|
 Document's HTML source with WebBrowser control?
Quote: > > Thank you for your answer. Unfortunately, that won't work in my case. There > > is HTML form what I need to fill and post, and then retrieve receive result > > document's HTML code, so, there is no exact URL.. > Can the results be opened in a new window with a normal web browser? > If so, you may be able to get it's "results URL" from there and then
Yes, results can be opened in a new window, but URL is always the same, document is created by (java) script running in server (it ends with .jsp).
|
Fri, 27 Feb 2004 05:55:07 GMT |
|
 |
Root #6 / 12
|
 Document's HTML source with WebBrowser control?
Quote: > Yes, results can be opened in a new window, but URL is always the same, > document is created by (java) script running in server (it ends with .jsp).
But if the URL is the same then you should be able to read the Java-generated source after the submission, or am I missing something? Please show me the page so I can take a look...
|
Fri, 27 Feb 2004 06:05:56 GMT |
|
 |
Hugh Laderma #7 / 12
|
 Document's HTML source with WebBrowser control?
WebBrowser1.Document.Body.InnerHtml maybe ?
Quote:
> > > Thank you for your answer. Unfortunately, that won't work in my case. > There > > > is HTML form what I need to fill and post, and then retrieve receive > result > > > document's HTML code, so, there is no exact URL.. > > Can the results be opened in a new window with a normal web browser? > > If so, you may be able to get it's "results URL" from there and then > Yes, results can be opened in a new window, but URL is always the same, > document is created by (java) script running in server (it ends with .jsp).
|
Fri, 27 Feb 2004 06:29:48 GMT |
|
 |
Olli Ihamak #8 / 12
|
 Document's HTML source with WebBrowser control?
Quote: > > Yes, results can be opened in a new window, but URL is always the same, > > document is created by (java) script running in server (it ends with .jsp). > But if the URL is the same then you should be able to read the Java-generated > source after the submission, or am I missing something? Please show me the > page so I can take a look...
Well, URL is always same, but page contents is not. Page in question is avaiable in Finnish only, so it might be difficult to understand it. However, form to fill is in page http://www.veikkaus.fi/jsp2/lottosivu_FP.jsp on the right, with text "Aikaisempien kierrosten oikea rivi ja voitonjako", two textboxes under this text should be filled, and then image with "HAE" should be clicked. When forum is posted, reponse begins with "Oikeat rivit ja voitonjaot kierroksittain". This is the document which source I need. If you change values in those two textboxes, you see that responese's URL is same, but contents is not.
|
Fri, 27 Feb 2004 06:13:40 GMT |
|
 |
Olli Ihamak #9 / 12
|
 Document's HTML source with WebBrowser control?
Quote: > WebBrowser1.Document.Body.InnerHtml maybe ?
Wow, that works! Thank you very, very much! And, it seems, that InnerText works also. This is great! Is there list avaiable of WebBrowser.Document's general members (right term?) that are avaiable with all documents?
|
Fri, 27 Feb 2004 06:44:59 GMT |
|
 |
Root #10 / 12
|
 Document's HTML source with WebBrowser control?
Quote: > If you change values in those two textboxes, you see that responese's URL is > same, but contents is not.
Yes, I see the problem. The URL's source is made up from a JavaScript at the other end, not our end. Hmm. Don't know what to do at this time.
|
Fri, 27 Feb 2004 07:11:26 GMT |
|
 |
Howard Henry Schlunde #11 / 12
|
 Document's HTML source with WebBrowser control?
The Webbrowser.Document returns an IHTMLDocument (IE4.0+) and an IHTMLDocument2 (IE 4.0+) as well as an IHTMLDocument3 (IE 5.0+) object. Those object types are defined in the mshtml.dll/mshtml.tlb file, AKA Microsoft HTML Object Library. To get a list as requested, press CTRL+T, check the Microsft HTML Object Library, press F2, and select the appropriate item under the "Classes" ListBox. To early bind and use IntelliSense while coding, try something like: Private Sub Command1_Click() Dim HTMLDoc As IHTMLDocument2 Set HTMLDoc = WebBrowser1.Document Debug.Print HTMLDoc.body.innerHTML End Sub The documentation for the whole WebBrowser control (including the Document object) can be found at [ http://msdn.microsoft.com/workshop/browser/webbrowser/reflist_vb.asp?fra me=true ], but note that some documentation may be implemented slightly differently due to VB's nonuse of pointers. Howard Henry Schlunder
Quote:
> > WebBrowser1.Document.Body.InnerHtml maybe ? > Wow, that works! Thank you very, very much! > And, it seems, that InnerText works also. This is great! > Is there list avaiable of WebBrowser.Document's general members (right > term?) that are avaiable with all documents?
|
Fri, 27 Feb 2004 07:25:51 GMT |
|
 |
Frank Ad #12 / 12
|
 Document's HTML source with WebBrowser control?
On Sun, 09 Sep 2001 23:25:51 GMT, "Howard Henry Schlunder"
I've also found that the J++ documentation in the MSDN is pretty much the same to what's available with the webbrowser control. Not very surprisingly. :) Quote: >The Webbrowser.Document returns an IHTMLDocument (IE4.0+) and an >IHTMLDocument2 (IE 4.0+) as well as an IHTMLDocument3 (IE 5.0+) object. >Those object types are defined in the mshtml.dll/mshtml.tlb file, AKA >Microsoft HTML Object Library. To get a list as requested, press >CTRL+T, check the Microsft HTML Object Library, press F2, and select the >appropriate item under the "Classes" ListBox. To early bind and use >IntelliSense while coding, try something like: >Private Sub Command1_Click() >Dim HTMLDoc As IHTMLDocument2 > Set HTMLDoc = WebBrowser1.Document > Debug.Print HTMLDoc.body.innerHTML >End Sub >The documentation for the whole WebBrowser control (including the >Document object) can be found at [ >http://msdn.microsoft.com/workshop/browser/webbrowser/reflist_vb.asp?fra >me=true ], but note that some documentation may be implemented slightly >differently due to VB's nonuse of pointers. >Howard Henry Schlunder
>> > WebBrowser1.Document.Body.InnerHtml maybe ? >> Wow, that works! Thank you very, very much! >> And, it seems, that InnerText works also. This is great! >> Is there list avaiable of WebBrowser.Document's general members (right >> term?) that are avaiable with all documents?
Regards, Frank
|
Fri, 27 Feb 2004 08:19:35 GMT |
|
|
|