Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 16th, 2012, 08:38 AM
JugglingReferee JugglingReferee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 52 JugglingReferee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 23 m 12 sec
Reputation Power: 13
[VB6] parsing contents of web page

Hi.

Posting for a friend. I don't use VB6, so I hope that I type everything correctly.

He's got a WebBrowser object. As I understand it, if he sets WebBrowser1.Navigate to be a URL, the WebBrowser object will go to the URL in question.

If the URL spits back only one word, such as a name, how can that text be acccessed?

(The text has no HTML formatting. It is simply Mark or Ernie.)

Is there a property such as WebBrowser.HTMLPageText or similar?

Reply With Quote
  #2  
Old May 16th, 2012, 11:09 AM
JugglingReferee JugglingReferee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 52 JugglingReferee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 23 m 12 sec
Reputation Power: 13
Found this site:

http://www.tek-tips.com/viewthread.cfm?qid=832833

Can anyone confirm that

Quote:
StringVariable = WebBrowser1.Document.body.innerText


may do the trick?

Reply With Quote
  #3  
Old May 16th, 2012, 11:21 AM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Apr 2004
Location: OAKLAND CA | Adam's Point (Fairyland)
Posts: 14,938 medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 6 Months 2 Weeks 2 Days 19 m 8 sec
Reputation Power: 8490
Facebook
From what I recall that looks right.
__________________
medialint.com

“Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss

Reply With Quote
  #4  
Old May 29th, 2012, 08:10 PM
JugglingReferee JugglingReferee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 52 JugglingReferee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 23 m 12 sec
Reputation Power: 13
So my friend is getting VB run-time error #91 at the following statement:

var = WebBrowser1.Document.body.innertext


The WebBrowser1 object should receive a simple 8 bytes from the webpage that it visits.

Any ideas what causes this error with this object?

Reply With Quote
  #5  
Old May 30th, 2012, 01:16 PM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Apr 2004
Location: OAKLAND CA | Adam's Point (Fairyland)
Posts: 14,938 medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 6 Months 2 Weeks 2 Days 19 m 8 sec
Reputation Power: 8490
Facebook
Stick a DoEvents after the navigate, before you reference the browser...

Code:
Private Sub CommandButton1_Click()
    Me.WebBrowser1.Navigate "http://medialint.com"
    Do
        DoEvents
    Loop While Me.WebBrowser1.ReadyState <> READYSTATE_COMPLETE
    MsgBox Me.WebBrowser1.Document.body.innertext
End Sub


I tested this in Excel, got the same error until I added the test. Initially it seemed DoEvents would do it but testing the readystate seemed more reliable

Last edited by medialint : May 30th, 2012 at 01:20 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > [VB6] parsing contents of web page

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap