#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Berlin,Germany
    Posts
    6
    Rep Power
    0
    Hi to All!

    I want to read a html site on the net. And the php script must catch (or better parse?) all the data
    between <td> </td> to put it in a txt file. Can anyone of you help me out?

    <TABLE bgColor=#cccccc border=1 cols=5 width="100%">
    <TBODY>
    <TR>
    <TD>Gabler Joachim</TD>
    <TD>&nbsp;</TD>
    <TD>Goethestr. 5, 14163 Berlin</TD>
    <TD>&nbsp;030-809729-0</TD>
    <TD>&nbsp;</TD></TR>
    <TR>
    <TD>Gabriel Christian</TD>
    <TD>&nbsp;</TD>
    <TD>Otto-Suhr-Allee 97, 10585 Berlin</TD>
    <TD>030-3416024</TD>
    <TD>030-3419042</TD></TR>
    .......
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Ontario, Canada
    Posts
    498
    Rep Power
    18
    Here's one thing you can do (forgive my code, I've never tried something like this):

    $fp = fopen("http://url.com/page.html","r");
    while($line = fgets($fp,4096)) {
    if (ereg("[<td>]|[</td>]",$line)) {
    $retval = strip_tags($line);
    }
    }
    return $retval;

    Once again, forgive the sloppiness of the code (and probably the mis-use of ereg()), but I think this is an example of what you're trying to do.

    ------------------
    To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson

Similar Threads

  1. cannot read STDIN from HTML form
    By bkd52 in forum Perl Programming
    Replies: 18
    Last Post: February 5th, 2004, 09:59 PM
  2. read iframe html.....write to form, string..etc.
    By dave777 in forum HTML Programming
    Replies: 0
    Last Post: February 2nd, 2004, 12:27 PM
  3. read iframe html.....write to form, string..etc.
    By dave777 in forum HTML Programming
    Replies: 1
    Last Post: February 2nd, 2004, 10:14 AM
  4. read iframe html.....write to form, string..etc.
    By dave777 in forum PHP Development
    Replies: 2
    Last Post: February 2nd, 2004, 10:11 AM
  5. Replies: 1
    Last Post: January 30th, 2004, 02:10 AM

IMN logo majestic logo threadwatch logo seochat tools logo