Jump to content

How can I parse data out of the HTML page I am downloading?


torontobb

Recommended Posts

Hi Everyone,

 

I have been successful to parse out some data out of an html page that I am downloading using CURL. I used arrays and preg_match to get the data I need. However, some part of the data has a great deal of SPACE charecters and it seems that my arrays method doesn't work. Can someone please point out how I can parse the following to get only the information out and not tags (****quoted excerpt including all the space characters like it was downloaded):

<span class="basic_serial">(777) 777-7777</span>

												<br />









										1111 ABCD, EFGH, IJKL

										<br />

 

 

Thanks,

I guess what I am asking is how to parse out line carriage when I using array like this:

 

$regData = array("/<br />(.+)<br />/",);

 

That returns nothing because there is new lines between the two <br /> and I only need the data between the two <br />

 

Should I do something like:

 

$regData = array("/<br />chr\(13\).chr\(13\).chr\(13\).chr\(13\)(.+)<br />/",);

 

compensating for New Lines. I am clueless....

 

Any input is appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.