Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual 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 ASP Free Forums Sponsor:
  #1  
Old June 1st, 2006, 11:34 AM
Padraic Padraic is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 20 Padraic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 45 m 28 sec
Reputation Power: 0
Get the html source from a URL

Hello all,

Does anyone know how to get the Html source code from a URL within a vb 6.0 application??

Reply With Quote
  #2  
Old June 1st, 2006, 09:10 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 57 m 26 sec
Reputation Power: 181
One way is to use the webbrowser control. Another is to use the MS Inet Control
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old June 2nd, 2006, 10:14 AM
Padraic Padraic is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 20 Padraic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 45 m 28 sec
Reputation Power: 0
Cheers Doug,

I got it working. I tried using the browser control but I could not get the source code from that. I could only display the html page.

If anyone else is interested.

Add as a component the Microsoft Internet Transfer Control. This should add an extra icon to your toolbar. Add this icon to your form and give it a name (inet1). Then it is as simple as :

inet1.OpenURL

This returns the source code as text.

Reply With Quote
  #4  
Old June 2nd, 2006, 09:55 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 57 m 26 sec
Reputation Power: 181
FYI, you have access to the entire page Document DOM object in the webbrowser control, so you can get the page source. I havent't reviewed any code, but off the top I think you use

wbcontrol.document.<whatever> just as you would in js.

Reply With Quote
  #5  
Old June 8th, 2006, 12:40 PM
ROdrigo Perez ROdrigo Perez is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 2 ROdrigo Perez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 50 m 23 sec
Reputation Power: 0
Msxml2.ServerXMLHTTP

Quick example:


Dim oxmlhttp As New Msxml2.ServerXMLHTTP

'oxmlhttp.setTimeouts(resolveTimeout, connectTimeout, sendTimeout, receiveTimeout)
oxmlhttp.setTimeouts 50000, 50000, 600000, 600000

'oxmlhttp.Open "GET", "https://www.anysite.com?cmd=LIST", False
oxmlhttp.Open "GET", strURLnVars, False ' True is asynch, False is synch

' Use proxy if provided (some implementations dont support SetProxy)
If strGBSProxy<>"" Then oxmlhttp.setProxy 2, strGBSProxy

'Error: -2147012858 The code below solves the ocurrence of this error
' Description: The host name in the certificate is invalid or does not match
Const SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
oxmlhttp.setOption 2, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS

' Send the request
oxmlhttp.Send

'While oxmlhttp.readyState <> 4
' oxmlhttp.waitForResponse 1000
'Wend

The source of the page can be read from " oxmlhttp.responseText "
The status of the page from " oxmlhttp.Status " (200, 500, 404 and such)

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Get the html source from a URL


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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT