473,395 Members | 1,468 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,395 software developers and data experts.

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

Jul 17 '05 #1
5 1762
Alon wrote:
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 ?


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, "Authorization: Basic " . base64_encode("user:pass") . "\r\n");

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

Jul 17 '05 #2
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

Jul 17 '05 #3
IR, i meant IE.

Rgds
NILESH

Jul 17 '05 #4
bluenile wrote:
IR, i meant IE.


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

Jul 17 '05 #5
"Alon" <al******@hotmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
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.)


See http://www.php.net/stream_context_create/ and
http://www.php.net/stream_get_meta_data/ .
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Paul Robinson | last post by:
I am developing a website in ASP that connects to a Sybase database. However, when I try to open a connection to the database the page will not load. The script does not timeout, nor the...
5
by: Nicolae Fieraru | last post by:
Hi All, I use VC .Net 2003 and I want to create a small program which is able to read the source code of a web site. I have a textbox with the URL, a button and a multiline textbox for the...
1
by: Lorenzo | last post by:
Hi i'm writing some code that retrieve the html source code of an asp page. The problem is that if i go directly to this page the browser redirect me to a login page where are two textbox in a...
6
by: omyek | last post by:
I'm trying to mimic the browsing of a webpage using an HttpWebRequest. I've had a lot of luck with it so far, including logging into pages, posting form data, and even collecting and using cookies....
1
by: Ray Cacciatore | last post by:
My login.aspx page uses a MasterPage and is implemented as a Content page. However, I keep getting the error "A page can have only one server-side Form tag." when I run it. Yet there is not FORM tag...
0
by: Dam6 | last post by:
Hello, Having a bit of trouble with a simple login page etc using an access db. (Using DW 2004 and databases from Sean R. Nicholson) I've created a virtual application, added the dw ctrls and...
1
by: sharp2037 | last post by:
Hi Everyone, I am working on an ASP.net application and I have a homepage to which everyone visits of course and on that front page I have a user ID and password box and a login button. What...
4
Invisible Bunny King
by: Invisible Bunny King | last post by:
Hi. I am mostly a Dreamweaver user as opposed to a coder, so bear with me. I have created a login page for my site. On my testing server, everything worked perfectly. It would look for the user in...
1
by: moris7 | last post by:
Hi everyone, i tried a lot but i don't seem to be able to do anything conclusive ! Here what i want to do : LogIn in a webpage using this URL : ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.