Click to See Complete Forum and Search --> : robot to read html from other websites


niladhar8@gmail.com
November 24th, 2009, 10:11 AM
would like to know if there is a way for me to write a php script that would behave like a robot and read html content from other websites. Lets say i was selling something and i wanted to know what my competitors are pricing their products at.... is there a possiblity to write a php script that would help me do that.

PeejAvery
November 24th, 2009, 10:21 AM
Very simple. The only thing you would need to do to keep it active is to set it to run as a scheduled task/cron job.

EDIT: You already know how to read files, right? I'm assuming that you've at least gotten that far in PHP.

niladhar8@gmail.com
November 24th, 2009, 10:23 AM
Very simple. The only thing you would need to do to keep it active is to set it to run as a scheduled task/cron job.

Yes i do know about cron jobs but how would i write a script to go in and read another site's html content? I have no clue on how to do this and i did google it but i guess i wasn't using the right words to get me to something interesting and helpful.

niladhar8@gmail.com
November 24th, 2009, 10:24 AM
Very simple. The only thing you would need to do to keep it active is to set it to run as a scheduled task/cron job.

EDIT: You already know how to read files, right? I'm assuming that you've at least gotten that far in PHP.

yes i do know how to read files, but would that be the same as reading a webpage as well?

PeejAvery
November 24th, 2009, 10:36 AM
The reading of the file would be the exact same. Parsing would just have to be done using regular expressions to match specific X/HTML tags.

niladhar8@gmail.com
November 24th, 2009, 10:38 AM
The reading of the file would be the exact same. Parsing would just have to be done using regular expressions to match specific X/HTML tags.

oh i never thought it would be that easy... i am going to try out a few things and will post if i get into trouble which most probably i will. tx.