-
Nov 18th, 2005, 04:06 PM
#1
Thread Starter
New Member
downloading a web page into a text box.
I've only just started playing around with the internet controls and stuff so I'm pretty much a n00b at this but this is what i want to do. I want to download a website into a text box then filter out all some of it so i'm left with what i want. I'm alright when comes to the filtering but when I download a page it only downloads half of it. My code for downloading a page is:
VB Code:
Text2.Text = Inet1.OpenURL("http://www.4q.cc/vin/")
Please help, Thanks in Advanded.
-
Nov 18th, 2005, 05:38 PM
#2
Fanatic Member
Re: downloading a web page into a text box.
Perhaps you may want to use a Rich Text Box , instead of a regular text box. There are size limits on the standard textbox and I wonder if perhaps that might be causing a problem...
I'm also a relative N00B to VB and especially iNet controls.. so this may or may not help at all
-
Nov 18th, 2005, 06:50 PM
#3
Re: downloading a web page into a text box.
I tried your code and had no trouble.
Length of text put into the textbox was 6958 (7311 if not multiline) characters.
-
Nov 18th, 2005, 07:31 PM
#4
Thread Starter
New Member
Re: downloading a web page into a text box.
Thank you for your quick response , I tried the rich text box but still I have the same problem. I think it might be timing out or only showing the amount it has downloaded within a time. this is how far mine got. But then I relised that is stoping always after the ";creative=932" bit. Any ideas?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Random Vin Diesel Fact</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="alternate" title="Random Vin Diesel Fact RSS" href="http://www.4q.cc/vin/rss.php" type="application/rss+xml"/>
<meta name="keywords" content="vin diesel, comedy, humor, acting, xxx, cell phones, news, university, movies, dvd, posters, travel, sex, shopping, college, school, free" />
<meta name="description" content="Displays a random 'fact' about Vin Diesel" />
</head>
<body>
<!-- <p class="bottom"><a href="http://www.amazon.com/exec/obidos/redirect?link_code=ur2&camp=1789&tag=randomvindies-20&creative=932
-
Nov 18th, 2005, 08:36 PM
#5
Hyperactive Member
Re: downloading a web page into a text box.
Why not use the URLDownloadToFile api ?
VB Code:
Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
-
Nov 18th, 2005, 09:59 PM
#6
Thread Starter
New Member
Re: downloading a web page into a text box.
Thanks for the reply, how do I use this to put the code into a textbox or varible. Thanks.
-
Nov 18th, 2005, 10:05 PM
#7
Re: downloading a web page into a text box.
Try this:
VB Code:
Option Explicit
Private Sub Form_Load()
Dim x As Integer, st As String
Dim ff As Integer
ff = FreeFile
Open App.Path & "\to do.txt" For Input As #ff ' Supply path and filename
Text1.text = Input(LOF(ff), ff)
Close #ff
End Sub
-
Feb 9th, 2006, 10:51 AM
#8
New Member
Re: downloading a web page into a text box.
What exactly are you looking for in the source of the website? You might be able to parse the HTML and find it there? Parsing gives you tags such as IMG and Links If you need more then that then parsing isn't the road to go.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|