Screen scraping question

Discussion in 'ASP .Net' started by =?Utf-8?B?VmljdG9y?=, Oct 12, 2005.

  1. I'm doing screen scraping by retrieving data from one site and entering into
    another site.
    I have a problem with logging into the site. User name and password field
    contain 'name' property, and therefore I can easily do assign statement to
    them.
    "userid=uidTest&password=pwTest"

    However, submit button represented on page via hyper link:
    <A href="javascript:login()" onBlur ="foc()"><IMG align=middle border=0
    height=15 src="images/submit.gif" width=64></A>

    How can I refer to it? And what should I assign to it in my code?

    Following is my c# code:
    byte[] _bParameters = null;
    byte[] _bResponse = null;
    string _response = "";
    pParameters = "userid=uidTest&password=pwTest"; // how to assign hyperlink?
    _bParameters = Encoding.ASCII.GetBytes(pParameters);
    _bResponse = _wc.UploadData(pURI, "POST", _bParameters);
    _response = System.Text.Encoding.ASCII.GetString(_bResponse);


    Thanks,
    Victor
     
    =?Utf-8?B?VmljdG9y?=, Oct 12, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?VmljdG9y?=

    Bruce Barker Guest

    you have to look at the javascript source and see what it does, then
    duplicate the logic in your code.

    -- bruce (sqlwork.com)


    "Victor" <> wrote in message
    news:...
    > I'm doing screen scraping by retrieving data from one site and entering
    > into
    > another site.
    > I have a problem with logging into the site. User name and password field
    > contain 'name' property, and therefore I can easily do assign statement to
    > them.
    > "userid=uidTest&password=pwTest"
    >
    > However, submit button represented on page via hyper link:
    > <A href="javascript:login()" onBlur ="foc()"><IMG align=middle border=0
    > height=15 src="images/submit.gif" width=64></A>
    >
    > How can I refer to it? And what should I assign to it in my code?
    >
    > Following is my c# code:
    > byte[] _bParameters = null;
    > byte[] _bResponse = null;
    > string _response = "";
    > pParameters = "userid=uidTest&password=pwTest"; // how to assign
    > hyperlink?
    > _bParameters = Encoding.ASCII.GetBytes(pParameters);
    > _bResponse = _wc.UploadData(pURI, "POST", _bParameters);
    > _response = System.Text.Encoding.ASCII.GetString(_bResponse);
    >
    >
    > Thanks,
    > Victor
    >
     
    Bruce Barker, Oct 12, 2005
    #2
    1. Advertising

  3. Bruce,

    Thanks for response.
    I was trying to figure out what to send in pParameters variable and so far
    no luck.

    Script looks like this:
    <script language=\"JavaScript1.2\">
    function login()
    {
    document.login.method=\"post\";
    document.login.action=\"/servlet/com.main.tmt.servlets.TmtLoginServlet\";
    document.login.submit();
    }
    // end function
    function foc() {
    document.login.userid.focus();
    }
    </script>

    Thanks,
    Victor


    "Bruce Barker" wrote:

    > you have to look at the javascript source and see what it does, then
    > duplicate the logic in your code.
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "Victor" <> wrote in message
    > news:...
    > > I'm doing screen scraping by retrieving data from one site and entering
    > > into
    > > another site.
    > > I have a problem with logging into the site. User name and password field
    > > contain 'name' property, and therefore I can easily do assign statement to
    > > them.
    > > "userid=uidTest&password=pwTest"
    > >
    > > However, submit button represented on page via hyper link:
    > > <A href="javascript:login()" onBlur ="foc()"><IMG align=middle border=0
    > > height=15 src="images/submit.gif" width=64></A>
    > >
    > > How can I refer to it? And what should I assign to it in my code?
    > >
    > > Following is my c# code:
    > > byte[] _bParameters = null;
    > > byte[] _bResponse = null;
    > > string _response = "";
    > > pParameters = "userid=uidTest&password=pwTest"; // how to assign
    > > hyperlink?
    > > _bParameters = Encoding.ASCII.GetBytes(pParameters);
    > > _bResponse = _wc.UploadData(pURI, "POST", _bParameters);
    > > _response = System.Text.Encoding.ASCII.GetString(_bResponse);
    > >
    > >
    > > Thanks,
    > > Victor
    > >

    >
    >
    >
     
    =?Utf-8?B?VmljdG9y?=, Oct 14, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Martinez

    Screen Scraping C#

    Robert Martinez, Aug 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,819
    Robert Martinez
    Aug 26, 2003
  2. George Durzi

    HTML Screen Scraping Q

    George Durzi, Feb 25, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    538
    George Durzi
    Feb 25, 2004
  3. niv

    screen scraping question

    niv, Oct 8, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    443
    Scott Allen
    Oct 8, 2004
  4. David Jones

    Web Scraping/Site Scraping

    David Jones, Jul 11, 2004, in forum: Python
    Replies:
    4
    Views:
    553
    Andrew Bennetts
    Jul 13, 2004
  5. jeffbg123

    Screen Scraping Question

    jeffbg123, Jul 11, 2007, in forum: Python
    Replies:
    4
    Views:
    406
    Yu-Xi Lim
    Jul 14, 2007
Loading...

Share This Page