|
-
Jul 29th, 2005, 04:24 PM
#1
Thread Starter
New Member
Help Me! - How to extract website's contents using VB - Help Me!
Hi there!
I am a vb programmer. I have a problem in my last project and welcome any solution from you.
I am developing a program to connect to internet and extract some information from some websites. I am able to code extraction using winsock, API or inet control. These websites uses login and cookies and check it in each HTTP request. Websites uses POST method for login so I can't include info in URL as a GET action. I also able to code HTTP POSTs using either Winsock or Inet. So I can POST a login username and password.
Problem:
1.Some websites use session, When I login and request next page it lose the session so request login again! Websites I said about are ASP and JSP technologies based websites. ASPs maybe uses some built-in variables or cookies but I see something like "jsession=" in JSP URLs, However I try to include it in next call but problem continues.
2.Some websites use cookies, (maybe problem comes from cookies). I don't know how I can save, get and post cookies for next call.
3.Some websites also check the browser for cookies and java compatiblity, so they reject login request from Winsock and Inet. I don't know how I can set browser-agent-name in Inet but It's OK for Winsock control.
However I thing that my problem based in sessions or cookies. I need a solution (source code, example project or reference about this problem) that show me how I can LIVE a session or cookie during several visits of a website? How I can import session and login info from one page visit to another? Or my solution is completely worng and I have to change the way?
It's a program that have to login to websites, go to next page after login page (a search page) and fill and submit a form (search query) and exract some information from results page's HTML tags. All my problem is for logon and borwser checkups.
Thank you...
Max
Last edited by maxcoder; Jul 29th, 2005 at 04:34 PM.
-
Aug 5th, 2005, 10:23 AM
#2
Re: Help Me! - How to extract website's contents using VB - Help Me!
Welcome to the forums 
I would say your best bet is to use the WebBrowser control, which will handle things like cookies, etc. Are you using VB6 or VB.NET?
-
Aug 6th, 2005, 11:26 AM
#3
Retired VBF Adm1nistrator
Re: Help Me! - How to extract website's contents using VB - Help Me!
I'll post my scraper in a minute....
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Aug 6th, 2005, 07:03 PM
#4
Lively Member
Re: Help Me! - How to extract website's contents using VB - Help Me!
It might make it easier to take a look at what your browser sends to X site using a packet sniffer like Ethereal, or something known as "appsniff" which does quite the same thing on a higher level - with winsockets that is.
Coding this sort of stuff isn't fun
-
Aug 7th, 2005, 03:07 AM
#5
Thread Starter
New Member
Re: Help Me! - How to extract website's contents using VB - Help Me!
 Originally Posted by plenderj
I'll post my scraper in a minute....
can you show me download URL? thanks.
-
Aug 7th, 2005, 03:08 AM
#6
Thread Starter
New Member
Re: Help Me! - How to extract website's contents using VB - Help Me!
How I can change agent name of browser? I thing that website find what I am using and say that I need an IE browser.
-
Aug 7th, 2005, 03:09 AM
#7
Thread Starter
New Member
Re: Help Me! - How to extract website's contents using VB - Help Me!
 Originally Posted by penagate
Welcome to the forums 
I would say your best bet is to use the WebBrowser control, which will handle things like cookies, etc. Are you using VB6 or VB.NET?
I use VB6. I did not work with webbrowser. can you show me some reference or useful examples? thanks,
-
Aug 7th, 2005, 05:46 AM
#8
Retired VBF Adm1nistrator
Re: Help Me! - How to extract website's contents using VB - Help Me!
 Originally Posted by maxcoder
can you show me download URL? thanks. 
Here, but it's in .NET:
http://www.vbforums.com/showthread.p...87#post2114287
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
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
|