For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > January 2005 > PHP ques: Webpage retrieval and parsing









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PHP ques: Webpage retrieval and parsing
news

2005-01-16, 3:57 am

Hi again, I am pretty new to PHP (I use to be a Visual Basic 6 addict)

I want to do the following but I have been unable to find good info/ or
sample code on it; please help;

- retrieve a webpage using PHP from another site (the url have parameters
like (?date=january) in it if that makes a difference)

- using PHP code I want to Parse a table (perhaps using DomDocument
object?) I want to retrieve data from the table cell first by row and
then by column.
(retrieve the data to be store in data object)

- Then I want to use the data object to display the information retrieve in
webpage?


I am looking for sample codes, references or anything of that nature to help
me.
Thank you in advance. and please be as detail as you like.

Joe.



ppalmieri@gmail.com

2005-01-16, 3:57 am

Hi,

welcome to PHP! --

First take a look a CURL -
http://www.php.net/curl

That, used correctly will load the content of a url into a variable..
Then to parse outa table you will need to use some creative REGEX to
pull out the table/tr/td etc..

I have seen somewhwere, try searching google, someone wrote a class
similer to simpleXML that pulls an html table and loads it as a usuable
object.

Phil


news wrote:
> Hi again, I am pretty new to PHP (I use to be a Visual Basic 6

addict)
>
> I want to do the following but I have been unable to find good info/

or
> sample code on it; please help;
>
> - retrieve a webpage using PHP from another site (the url have

parameters
> like (?date=january) in it if that makes a difference)
>
> - using PHP code I want to Parse a table (perhaps using DomDocument
> object?) I want to retrieve data from the table cell first by row

and
> then by column.
> (retrieve the data to be store in data object)
>
> - Then I want to use the data object to display the information

retrieve in
> webpage?
>
>
> I am looking for sample codes, references or anything of that nature

to help
> me.
> Thank you in advance. and please be as detail as you like.
>
> Joe.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com