Read external HTML page and then find data within

Posted by inthewayboy on Stack Overflow See other posts from Stack Overflow or by inthewayboy
Published on 2010-05-19T20:46:19Z Indexed on 2010/05/19 21:40 UTC
Read the original article Hit count: 124

Filed under:
|

I'm playing around with an idea, and I'm stuck at this one part. I want to read an external HTML page and then extract the data held within two <dd> tags. I've been using file_get_contents with good results, but I'm at a loss as to how to accomplish that last part. The two tags I want to extract the value from are always enclosed within a particular <div>, was wondering if that might help?

In my mind it reads the entire html file into a string, then dumps all the data up until this one particular <div>, and dumps all the data after the closing </div>. Is that possible? I think this needs regex syntax which I've never used yet. So any tips, links, or examples would be great! I can provide more info as necessary.

© Stack Overflow or respective owner

Related posts about php

Related posts about html