Jump to content

How to parse an HTML page?


Shamandalie

Recommended Posts

First of all, thanks to anyone who will try to answer this.

I'm doing a projet in which I need to get some information from a web page. I'm using Apache2 for windows and php 4.4.4.
I have to use the mod_status function to get information from the current requests of the server.
My server is on localhost (port 80) so I call the function with the request: [code]http://localhost/server-status[/code]
This is the page I get (printed it in 2 images):
[url=http://img225.imageshack.us/img225/1323/print1bl2.png]http://img225.imageshack.us/img225/1323/print1bl2.png[/url]
[url=http://img225.imageshack.us/img225/2077/print2yz0.png]http://img225.imageshack.us/img225/2077/print2yz0.png[/url]

The information I have to get from that page are:
Total Traffic: (ex.) 29 kB
Request:GET /server-status HTTP/1.1 (the Request part of the URL)

and I have to put them into a list that of objects to store the urls and the traffic that each request needed to be answered.

I have to put a new record in the list each time the server receives a request.
I have to write a php function to do that, but I have no clue how to start it. If you have some suggestion I'll be grateful.

Thanks again in advance.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.