By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,154 Members | 1,031 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,154 IT Pros & Developers. It's quick & easy.

Parsing Web Sites

P: n/a
Hi I need to parse particular web sites to extract paritcular information on
a weekly basis. How is this done in PHP and is PHP better at doing this than
JSP?
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Colum" <co********@hotmail.com> wrote in message
news:<Vi******************@news.indigo.ie>...

I need to parse particular web sites to extract paritcular
information on a weekly basis. How is this done in PHP
$remote = file_get_contents ('http://www.somesite.com/');

Now string $remote contains the entire index file for
http://www.somesite.com/. You can parse it, extract anything
you want from it, or do whatever you please with it.

As to the weekly basis, PHP itself has no scheduling tools.
You will have to use OS-level scheduling via cron on Unix
or Scheduler on Windows.
and is PHP better at doing this than JSP?


This is a very basic functionality, so it's highly unlikely
one scripting environment will be much better at it than
another...

Cheers,
NC
Jul 17 '05 #2

P: n/a
"Colum" <co********@hotmail.com> wrote in message news:<Vi******************@news.indigo.ie>...
Hi I need to parse particular web sites to extract paritcular information on
a weekly basis. How is this done in PHP and is PHP better at doing this than
JSP?


Get SNOOPY!

Charlie
Jul 17 '05 #3

P: n/a
Fox


Nikolai Chuvakhin wrote:

"Colum" <co********@hotmail.com> wrote in message
news:<Vi******************@news.indigo.ie>...

I need to parse particular web sites to extract paritcular
information on a weekly basis. How is this done in PHP
$remote = file_get_contents ('http://www.somesite.com/');


This is only available on php 4.3+ -- many hosts still only support
4.2.x or less... (like CIHost)

In case of php4.2-, use fsockopen and fgets

Now string $remote contains the entire index file for
http://www.somesite.com/. You can parse it, extract anything
you want from it, or do whatever you please with it.

As to the weekly basis, PHP itself has no scheduling tools.
You will have to use OS-level scheduling via cron on Unix
or Scheduler on Windows.
and is PHP better at doing this than JSP?


This is a very basic functionality, so it's highly unlikely
one scripting environment will be much better at it than
another...

Cheers,
NC

Jul 17 '05 #4

P: n/a
Fox wrote on Friday 05 December 2003 18:19:
$remote = file_get_contents ('http://www.somesite.com/');


This is only available on php 4.3+ -- many hosts still only support
4.2.x or less... (like CIHost)

In case of php4.2-, use fsockopen and fgets


If the host in question has the fopen wrappers enabled, you only need to use
file() or fopen() and fread(); socket functions would be an overkill for
that simple task.
Jul 17 '05 #5

P: n/a
Colum wrote:
Hi I need to parse particular web sites to extract paritcular information on
a weekly basis. How is this done in PHP and is PHP better at doing this than
JSP?


Unless you're a search engine, you're not gonna make yourself too
popular by harvesting information from other people's sites.
--
Bob
London, UK
echo Mail fefsensmrrjyaheeoceoq\! | tr "jefroq\!" "@obe.uk"
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.