Im trying to solve a captcha using 2Captcha.com
service. First I'm saving the captcha image:
urllib.urlretrieve(captcha_image_link, 'captcha.jpg')
Next I need to upload the image to the server to recognize it. Using plain requests its just as simple as
files = {'file': open('captcha.jpg', 'rb')}
payload = {'key': TWOCAPTCHA_APIKEY, 'method': 'post'}
request = requests.post('http://2captcha.com/in.php', files=files, data=payload)
But how to make the same request with Scrapy? I mean, how to attach an image file to a POST Request? Is this possible? If not, then I would like to know whether its too bad idea to use plain POST request (and urlretrieve as well) inside a Scrapy spider or not?