2 Replies - 7141 Views - Last Post: 14 November 2006 - 08:43 PM Rate Topic: -----

#1 ktsirig  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 14-September 05

web crawling PHP

Posted 02 November 2006 - 04:59 PM

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...

Is This A Good Question/Topic? 0
  • +

Replies To: web crawling PHP

#2 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

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.
Was This Post Helpful? 0
  • +
  • -

#3 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 84
  • View blog
  • Posts: 3,564
  • Joined: 31-March 03

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1