It is image tag on the page accessed by capybara via HTTPS protocol:
<img src="path">
Is it any way to get image file from the page using capybara with any kind of driver?
I can not use something like File.read('path') because image is also accessible via HTTPS only. My latest researches brought me to such kind of solution:
- Visit page
- Save page to png (webkit driver has such useful ability)
- Crop image
But I do believe that pretty solution exists.
Edited 1:
I've tried out padde's solution, but here is response body:
<html><head><title>Object moved</title></head>
<body>
<h2>Object moved to <a href=\"/Bledy/Blad404.aspx?aspxerrorpath=/CaptchaType.ashx\">here</a>.</h2>
</body>
</html>
Edited 2:
> curl -I image_path
5860cf30abf5d5480
HTTP/1.1 302 Found
Cache-Control: private
Content-Length: 168
Content-Type: text/html; charset=utf-8
Location: /Bledy/Blad404.aspx?aspxerrorpath=/CaptchaType.ashx
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sat, 03 Nov 2012 17:18:55 GMT
Object moved to here.
` It is simmilar to my previous wget and curl results. – FUT Nov 03 '12 at 17:04