473,399 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

VB6: Load Website / Retrieve data

Hello Everybody,

I am sure somebody would be able to help me, I will be forever in your debt :)

Here is the scenario, I have a website and say for this sake it is a profile database basically.

Right, I want Visual Basic to load say, my profile on the website so I put

http://www.<url>.com/search_profile.php=John011

It retreives the data and puts it on the webpage. The information retreived will display something like (in plain format (no fancy graphics on the page just plain text))

Firstname: John
Location: Home :P

What I basically want to do is put the profile name in Visual Basic, it loads the page in the background and saves that data to a text file on my computer for the profile I have searched.

I want to be able to search for a profile I put in, and it appends a file with any other profile which I might put in.

Thank you for you wisdom ! :)
Jun 28 '07 #1
3 8129
danp129
323 Expert 256MB
What have you written so far?
Jun 28 '07 #2
Ok, at the moment what I really need is just to load the page in the background of VB and then store that web page to a text file with the results.
Jun 28 '07 #3
danp129
323 Expert 256MB
Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Private Sub Command1_Click()
  3.     Dim sHTML
  4.     sHTML = RequestText("http://news.google.com")
  5.  
  6.     WriteToFile "c:\test.html", sHTML
  7.  
  8.     Debug.Print sHTML
  9. End Sub
  10.  
  11. Private Function RequestText(sURL, Optional sMethod = "POST")
  12.     'You may have caching issues using GET
  13.     Dim XMLHTTP
  14.     Set XMLHTTP = CreateObject("microsoft.XMLHTTP")
  15.     sMethod = UCase(sMethod)
  16.     XMLHTTP.Open sMethod, sURL, False
  17.     XMLHTTP.send (Null) '"x=x"
  18.     RequestText = XMLHTTP.responseText
  19.     Set XMLHTTP = Nothing
  20. End Function
  21.  
  22. Private Sub WriteToFile(sPath, sText)
  23.     Dim frfile As Long
  24.  
  25.     'open the text file to be written to
  26.     frfile = FreeFile()
  27.     Open sPath For Output Access Write As #frfile
  28.  
  29.     Print #frfile, sText
  30.  
  31.     Close #frfile
  32. End Sub
  33.  
  34.  
I usually do something like this unless there's a script that has to be run in javascript that writes the data I need to get after the document loads, in which case I use IE or a web browser control and read the innerhtml.
Jun 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Claudia Fong | last post by:
Hi, I have a form where I need to display the data of a department that stores in a access db. When I first load the form it will call a function name loaddata which will get the first...
1
by: funcSter | last post by:
I want to retrieve data from an Excel file like how I would with a database. I understand that I would have to use OLE DB. Somehow I think I cannot get the connection string right, as the bit of...
5
by: ggk517 | last post by:
We are trying to develop an Engineering application using PHP, Javascript with Informix as the back-end. Is it possible to retrieve data using Javascript but by accessing the Database. Say...
8
by: Yoshitha | last post by:
Hi I want to Extracet(retrieve) data from some of websites and the retrieved data has to be saved in excel or.csv files. I need to develop this in ASP.net(using C#.net Vs 2003). Can any...
1
by: deepaks85 | last post by:
Dear Sir, Is there any way to Get / Retrieve data from any website? I want the contents from a website into my website so that the contents can automatically update if the contents get changed...
1
by: hims | last post by:
hi i want to retrieve data from access through vb6.0 program but its not working. either sort out my error or help me with correct coding. thanks in advance !!!!!!! mail me at...
14
by: rinu mariam johnson | last post by:
I want to retrieve data from a website based on a file number.But i have to do this programmatically using vb.net and finally have to store the results in a csv file. In my web application,i will...
12
lifeisgreat20009
by: lifeisgreat20009 | last post by:
I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn't get much help so finally I am here.. Hoping of getting my problem solved. Please...
0
by: lenniekuah | last post by:
Hullo Good Guys, I need your help. Please help me. I am very surprise of this error message: Index was out of range. Must be non-negative and less thatnt he size of the collection. Parameter name...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.