Hello,
I am supposed to construct a page that searches in specific websites to extract information, like those sites from where you can rent a car for example. There is a form in the site where the user selects some fields (for instance departure and drop-off date), then the data are submitted to the other page that searches 2-3 sites and finds which cars are available on those dates.
I wanted to ask if there are ready scripts to do that, if not, some hints on how to start.
I am familiar with PHP forms and data extraction from mysql databases, but when you extract data from other sites, I have no clue how I can begin and deal with it...
web crawling PHP
Page 1 of 12 Replies - 6707 Views - Last Post: 14 November 2006 - 08:43 PM
Replies To: web crawling PHP
#2
Re: web crawling PHP
Posted 14 November 2006 - 06:04 PM
I'm not sure I understand entirely what you mean but if you want to get the contents of a site you can use something as simple as:
file_get_contents('http://www.somewebsite.com/someurl.html");
That will return all of the contents of that file in a string. Then it's just a matter of analyzing the string using string operations such as strpos() and substr() and the like.
#3
Re: web crawling PHP
Posted 14 November 2006 - 08:43 PM
Another way to to get data is to use the DOM. It's nice for tranversing the HTML document.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|