キャプチャ画像を含むフォームを送信するにはどうすればよいですか? このコードを試しました
import urllib
import urllib2
from PIL import Image
import pytesser
#include the pytesser into the site pacakges
#and run sudo apt-get tesseract-ocr it is required by the
#pytesser to run the image converter
image = urllib.URLopener()
image.retrieve("http://www.stat.gov.pl/regon/Captcha.jpg","Captcha.jpg")
#The image get saved into current script directory
image = Image.open('Captcha.jpg')
print image_to_string(image) #I will get the text from the Captcha Image
text=image_to_string(image)
ここで、このデータ dict を投稿で開かれたリクエストに送信して、次のページを詳細で構成するようにしたいと考えました
data={'criterion1TF':5213510101,'verifCodeTF':text}
しかし、urllib.URLopener() を使用すると、別のキャプチャ イメージを持つ新しいページが再び開きます。誰でもこれを解決するのを手伝ってくれることを願っています。前もって感謝します。