PDA

View Full Version : Curl getting html tags



aliahsan81
July 30th, 2009, 12:03 PM
I am making a script in which i wana use curl to download a web page and check status.But problem is when i use curl in linux command line it downlaod htlm tags.How can we ignore these tage any idea.

AlexC_
July 30th, 2009, 12:05 PM
You just want the response headers?

curl -I http://example.com

aliahsan81
July 30th, 2009, 12:16 PM
Thanks for quick reply.

I want to get page content to parse in my script.

AlexC_
July 30th, 2009, 12:19 PM
Thanks for quick reply.

I want to get page content to parse in my script.

What you get from CURL is the page content, you're getting the document returned from the server - which I assume is an HTML document, so of course it will have the HTML markup in it.

aliahsan81
July 30th, 2009, 12:21 PM
yes correct so there is some way i can remove these html tags

Mirge
July 30th, 2009, 02:23 PM
If using PHP, you can use strip_tags() (http://us3.php.net/strip_tags/)..