|
-
Sep 14th, 2001, 12:58 PM
#1
Thread Starter
Lively Member
Get Internet Site Source Code
Hi!
Does any know how to get the html code from a internet site?
Thanks!
-
Sep 14th, 2001, 01:14 PM
#2
Member
VB Code:
Private Sub Form_Load()
With Winsock1
.RemotePort = 80
.RemoteHost = [url]www.whatever.org/whatever.html[/url]
.Connect
End With
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim ReturnData As String
Dim Strdata2 As String
Dim ReturnData2 As String
Winsock1.GetData strData, vbString
List1.AddItem strData
End Sub
I suck so that probably wont work, made it up on spot.
U'll need to make a listbox called list 1, but if you have ie, why dont u just do
view > source
james

-
Sep 14th, 2001, 01:19 PM
#3
Thread Starter
Lively Member
Thanks for replying to my post so quickly!
I haven't tried it yet, but I will get back if it does not work.
Thanks very much!
-
Sep 14th, 2001, 02:17 PM
#4
Thread Starter
Lively Member
It dosen't work. How do I get the source code?
I forgot to answer your question. The reason I want it is so I can get some information from a web site.
Thanks!
-
Sep 14th, 2001, 03:22 PM
#5
PowerPoster
How about this...requires a textbox and inet control
VB Code:
Text1.Text = Inet1.OpenURL("http://www.vbforums.com")
-
Sep 15th, 2001, 07:19 AM
#6
Fanatic Member
Info.
I wrote some code in this thread for downloading a web page using HTTP Protocol with the Winsock control. Check it out: http://forums.vb-world.net/showthrea...hreadid=100775
Please, please search the forums first. This sort of question has been asked many times before... 
Hope this helps.
Laterz
Digital-X-Treme
Contact me on MSN Messenger: [email protected]
[VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
/ (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]
-
Sep 15th, 2001, 09:17 AM
#7
Frenzied Member
Originally posted by chrisjk
How about this...requires a textbox and inet control
VB Code:
Text1.Text = Inet1.OpenURL("http://www.vbforums.com")
this is the code that i always use
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Sep 15th, 2001, 02:08 PM
#8
You could also use the URLDownloadToFile API function.
VB Code:
Private 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
Private 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
'[b][u]Usage[/u][/b]
Private Sub Command1_Click()
DownloadFile "http://www.aol.com", "c:\aol.htm"
End Sub
-
Sep 20th, 2001, 06:04 PM
#9
Thread Starter
Lively Member
Thank you all very much for your replys.
I got it to work.
Thanks.
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
|