Results 1 to 8 of 8

Thread: Help Me! - How to extract website's contents using VB - Help Me!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Arrow 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.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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?

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    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]

  4. #4
    Lively Member
    Join Date
    May 2005
    Posts
    90

    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Help Me! - How to extract website's contents using VB - Help Me!

    Quote Originally Posted by plenderj
    I'll post my scraper in a minute....
    can you show me download URL? thanks.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    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.

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Help Me! - How to extract website's contents using VB - Help Me!

    Quote 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,

  8. #8
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: Help Me! - How to extract website's contents using VB - Help Me!

    Quote 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
  •  



Click Here to Expand Forum to Full Width