Page 1 of 1

reading specific tag contents using php and curl

Posted: Wed Apr 21, 2010 7:00 am
by saravanand
Hi,

I am using curl to get the page contents from a site. Then i get the entire content for the selected url and even checked that one by displaying it in a textarea. Now what i need is to select a specific tag and then there are child elements inside this tag. I want to select the parent tag and specific tags. I am new to using the regular expressions.

can any one please help me out of this problem.

advance thanks

regards,

d.saravanan

Re: reading specific tag contents using php and curl

Posted: Wed Apr 21, 2010 11:02 am
by requinix
What's the HTML you're looking for, and is it unique on the page?

Re: reading specific tag contents using php and curl

Posted: Thu Apr 22, 2010 12:54 am
by saravanand
Hi,

I solved this problem. however, need further details.

i am getting the search result in a complete html file from DOCTYPE XHTML tag till end of html tag. when i load this content in a html domdocument, it is reporting error and not able to load. also can you give me any regular expression to select the particular child of a parent tag.

regards

saravanan.

Re: reading specific tag contents using php and curl

Posted: Thu Apr 22, 2010 1:32 am
by requinix
Question still stands:
tasairis wrote:What's the HTML you're looking for, and is it unique on the page?
Also, what errors?