get page source after login

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alon

    #1

    get page source after login

    Hi,

    I want to get the source of a web page.
    The problem is that this page is accessible only after I login, using
    user name and password.
    I wrote a simple script to get a page source and it works as long as no
    login is necessary, but for the page I want I only get part of the
    source, while part is missing. The missing part is with the personal
    information.
    I have my username and password, but I don't know how to send them in
    the script, or what the other side is expecting.
    (I know the site uses cookies, to store the session information.)

    Any ideas ?

    TIA

    Alon

  • Janwillem Borleffs

    #2
    Re: get page source after login

    Alon wrote:[color=blue]
    > I have my username and password, but I don't know how to send them in
    > the script, or what the other side is expecting.
    > (I know the site uses cookies, to store the session information.)
    >
    > Any ideas ?
    >[/color]

    Use Firefox's Live HTTP Headers extension to see how the communtication is
    handled.

    When a basic realm login box pops up, authentication can be simulated
    through an an Authorization header:

    fputs($fp, "Authorizat ion: Basic " . base64_encode(" user:pass") . "\r\n");

    Be aware that in some cases, sending the Referrer and User-Agent headers are
    also required.


    JW



    Comment

    • bluenile

      #3
      Re: get page source after login

      JW

      Sorry about my ignorance, where do I find "Firefox's Live HTTP Headers
      extension", is there any such thing available for IR too.

      Thanks.

      Rgds
      NILESH

      Comment

      • bluenile

        #4
        Re: get page source after login

        IR, i meant IE.

        Rgds
        NILESH

        Comment

        • Janwillem Borleffs

          #5
          Re: get page source after login

          bluenile wrote:[color=blue]
          > IR, i meant IE.
          >[/color]

          This extension is only available for FireFox. Get a free copy from
          Mozilla.org, it's great for development.


          JW



          Comment

          • Chung Leong

            #6
            Re: get page source after login

            "Alon" <alonerez@hotma il.com> wrote in message
            news:1109497883 .054768.73220@o 13g2000cwo.goog legroups.com...[color=blue]
            > Hi,
            >
            > I want to get the source of a web page.
            > The problem is that this page is accessible only after I login, using
            > user name and password.
            > I wrote a simple script to get a page source and it works as long as no
            > login is necessary, but for the page I want I only get part of the
            > source, while part is missing. The missing part is with the personal
            > information.
            > I have my username and password, but I don't know how to send them in
            > the script, or what the other side is expecting.
            > (I know the site uses cookies, to store the session information.)[/color]

            See http://www.php.net/stream_context_create/ and
            http://www.php.net/stream_get_meta_data/ .


            Comment

            Working...