1

Possible Duplicate:
How to parse and process HTML/XML with PHP?

I want to grab anything thats inside the code below on a website.

<table class="eventResults byEvent vevent"></table>

How can I accomplish this? Thanks

Community
  • 1
  • 1
Victor Bjelkholm
  • 2,177
  • 9
  • 28
  • 50

3 Answers3

3

If you want to grab HTML from a site, you will want to use a DOM Parser. PHP has several XML processing packages to help you with this, be it DOM, SimpleXML or XMLReader. An often suggested alternative at SO is SimpleHtmlDom.

Since one of the class in the table is vevent, the content inside the table could be an hCalender microformat (can't tell for sure without seeing the content). If so, you can also use a microformat parser, preferably Transformr to save you the work of manually parsing the event data.

Community
  • 1
  • 1
Gordon
  • 312,688
  • 75
  • 539
  • 559
2

You can use the file_get_contents function or the curl extension for that.

Sarfraz
  • 377,238
  • 77
  • 533
  • 578
0

First fetch the content of the whole page from that website as a string, then use regular expression to extract the substring inside table tags.