because of bandwith problem, i’d like to block all images while using cURL on a remote url. Let me give a quick example: A page has 200 jpg images, i wanna get that page without 200 images with cURL.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When cURLing a URL, you’re only receiving what is at that URL, which is likely just an HTML document.
cURL does not automatically download all 200 images that are referred to in the HTML document, because cURL does not care about HTML. Quite the contrary; if you wanted to download all 200 images, you’d have to parse the HTML by hand and make further cURL request for each individual image.
Example from the command line:
That’s all a cURL request gets. There’s one image in there:
<img src="/2008/site/images/logo-w3c-mobile-lg" width="90" height="53" alt="W3C" />. That’s all you’re getting of it, you’re not getting the image itself.