0

php curl is reading style(css) files and downloading gifs,jpegs,pngs and everything. so curl is spending bandwith, and it is also taking times. actually i dont need images+css+etc. i only need to read html source codes..

well, is there a way to block images,css and other things while using php curl? so, curl works faster

2
  • If you are using curl to request 1 URL, it should only download what's at that URL ; can you show your code ? And are you sure it downloads the CSS/images ? Commented Feb 27, 2011 at 12:22
  • Please show some code. curl will usually download only the resource itself. Commented Feb 27, 2011 at 12:25

1 Answer 1

1

If you point cURL at a URL of a website it will download only the source HTML. You have to manually fetch CSS, images and other attachments via additional cURL requests to each of the resources URLs.

If you are having performance issues with cURL, consider paralleling your requests using curl_multi_* functions. http://www.php.net/manual/en/function.curl-multi-init.php

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.