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,

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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