2016-06-19 7 views
1

パスワードと認証コードを加えた1つのユーザー名でのみ動作します。ここで繰り返し送信フォーム

はロジックです:

def start_requests(self): 
    yield request(indexUrl, headers=headers, callback=self.downloadPic) 

def downloadPic(self, response): 
    # get cookies from the response and add it to the headers 
    yield request(picUrl, headers=headers, callback=self.handlePic) 

def handlePic(self, response): 
    # extract text from the picture 
    # form data include username, password and verification code 
    yield FormRequest(postUrl, formdata, headers=headers, callback=self.parse) 

は、我々はローカルでユーザ名とパスワードの多くを持っているとしましょう。そして、私はこのlogocを何回も繰り返すために、formdataのユーザー名とパスワードを変更するだけです。

forループを使用してすべてのユーザー名とパスワードを取得してから新しい要求を生成しようとしましたが、機能しません。

だからアイデアはありますか?

答えて

-1

私のスパイダーを呼び出すスクリプトを書いて、それにフォームデータを渡します。それは動作します!

関連する問題