|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
webbroswer source problemHi
I try to get the html source from webbrowser control. its giving me 'object variable or block variable not set'. How to solve this? ss = "www.website.com" Me.WebBrowser1.Navigate2 ss Do While True = (Me.WebBrowser1.Document Is Nothing) DoEvents Loop Text2.Text = WebBrowser1.Document.body.innerHTML -----------**ERROR** bala Try this instead
Private Sub Form_Load() Dim ss As String ss = "www.website.com" Me.WebBrowser1.Navigate2 ss End Sub Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) If (pDisp Is WebBrowser1.object) Then 'this gets the html Text2.Text = pDisp.Document.documentElement.innerHTML 'this gets the text ' Text2.Text = pDisp.Document.documentElement.innerText End If End Sub Show quoteHide quote "Bala" <B***@discussions.microsoft.com> wrote in message news:2FAF8972-66DB-4318-A5F4-DA9E9E4AAFF3@microsoft.com... > Hi > > I try to get the html source from webbrowser control. its giving me 'object > variable or block variable not set'. How to solve this? > > ss = "www.website.com" > Me.WebBrowser1.Navigate2 ss > Do While True = (Me.WebBrowser1.Document Is Nothing) > DoEvents > Loop > Text2.Text = WebBrowser1.Document.body.innerHTML -----------**ERROR** > > bala > Thanks. problem solved.
bala Show quoteHide quote "Norm Cook" wrote: > > Try this instead > > Private Sub Form_Load() > Dim ss As String > ss = "www.website.com" > Me.WebBrowser1.Navigate2 ss > End Sub > > Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As > Variant) > If (pDisp Is WebBrowser1.object) Then > 'this gets the html > Text2.Text = pDisp.Document.documentElement.innerHTML > 'this gets the text > ' Text2.Text = pDisp.Document.documentElement.innerText > End If > End Sub > > "Bala" <B***@discussions.microsoft.com> wrote in message > news:2FAF8972-66DB-4318-A5F4-DA9E9E4AAFF3@microsoft.com... > > Hi > > > > I try to get the html source from webbrowser control. its giving me > 'object > > variable or block variable not set'. How to solve this? > > > > ss = "www.website.com" > > Me.WebBrowser1.Navigate2 ss > > Do While True = (Me.WebBrowser1.Document Is Nothing) > > DoEvents > > Loop > > Text2.Text = WebBrowser1.Document.body.innerHTML -----------**ERROR** > > > > bala > > > > >
Other interesting topics
Intergating Multiple VB6.0 Projects into one: Project Grouping
Parsing UNIX text files Return an error code/message from a VB6 app Is this possible ? How to access related documents in VB through source code? Lost_Focus event of controls doesn't fire Intercept the Min/Max button Press Error 453: Can't find DLL entry point (VB6) Launching App Order of forms |
|||||||||||||||||||||||