using php curl in text only mode like lynx browser

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kc11
Forum Commoner
Posts: 73
Joined: Mon Sep 27, 2010 3:26 pm

using php curl in text only mode like lynx browser

Post by kc11 »

Hi,

I am trying to access a number of websites using curl. It seems to me that the some pages are slow to load, because of the time that it takes to populate the advertisements on the pages. Is there a way to use CURL in a 'text only' fashion, that will retrieve only the HTML ( which is all I'm interested in ) .

Thanks,

KC
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: using php curl in text only mode like lynx browser

Post by John Cartwright »

cURL will ONLY grab the HTML contents and not the external resources (such as images, js, flash). However, if you render the HTML from cURL by outputting it to the browser, then you will load all the external resources (NOT cURL).
kc11
Forum Commoner
Posts: 73
Joined: Mon Sep 27, 2010 3:26 pm

Re: using php curl in text only mode like lynx browser

Post by kc11 »

Thanks John, you've solved it and I'm not echoing the html output any longer. - Thank you - KC
Post Reply