Solved

vb6 InetControl Problem

Posted on 2010-11-20
2
738 Views
Last Modified: 2013-12-25
In VB6 put the Internet Control and a ListBox.
Then this code:
--------------------------------------------

 Dim str As String
  Dim ary() As String
  List1.Clear
 
  DoEvents
 
strHTML = Inet1.OpenURL(Trim("xxxxxxxx"), icString)

         str = strHTML
         ary = Split(str, vbLf)
         Dim x As Integer
         For x = 0 To UBound(ary)
            If ary(x) <> "" Then
                List1.AddItem (ary(x))
          End If
         Next
-----------------------------------------------
for "xxxxxxxx" put in:
http://www.USATODAY.com
and try it. YOu see the list box fills with text.
Now try:
http://www.whitepages.com/search/ReverseAddress?site_id=10583&street=7004%20POTTER%20RD&where=14047
and see the list box does not fill. Why ?
If you put the last URL into a browser.. you get a page and page source. ?
That is what I'm trying to get into the list box...page source for that URL.
0
Comment
Question by:p2pfire
2 Comments
 

Author Comment

by:p2pfire
ID: 34181148
?
0
 
LVL 22

Accepted Solution

by:
danaseaman earned 30 total points
ID: 34181981
Try using Winsock control.
Sample code can be found at:
http://www.ostrosoft.com/vb/projects/get_html_source.asp

Tried both URLs and they work OK with above code.

The second link returns:

HTTP/1.1 301 Moved Permanently
X-Runtime: 0.00488
Set-Cookie: search_beta=0; domain=.168.2.181; path=/; expires=Mon, 21 Nov 2011 05:19:21 GMT
Set-Cookie: _wpn_sid=f4bf98369636be11358dbf378c9e525a; domain=.168.2.181; path=/
Cache-Control: no-cache
Content-Length: 161
Date: Sun, 21 Nov 2010 05:19:21 GMT
Connection: close
Status: 301 Moved Permanently
Location: http://www.whitepages.com/10583/search/ReverseAddress?street=7004%20POTTER%20RD&where=14047
Server: nginx/0.7.67
Content-Type: text/html; charset=utf-8

<html><body>You are being <a href="http://www.whitepages.com/10583/search/ReverseAddress?street=7004%20POTTER%20RD&amp;where=14047">redirected</a>.</body></html>
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now