1

私は単純な問題を抱えていますが、解決策がわかりません。

casper.then(function(){
    this.fillSelectors(argFormSelector,{
        argLoginSelector : argLogin,
        argPwdSelector : argPwd
    },true);
});

しかし、debug_mode では何も表示されません...次のようになります。

[info] [phantom] Step anonymous 3/3 http://urlwebsite/ (HTTP 200) 
[info] [remote] attempting to fetch form element from selector:
'form[action^="/remote.php?act=formTargetGag"]' 
[info] [phantom] Step anonymous 3/3: done in 1950ms.

しかし、変数なしで同じことをしようとすると、すべて問題ありません。

casper.then(function(){
    this.fillSelectors(argFormSelector,{
'input[id="login_email"]': argLogin,
'input[id="login_password"]':argPwd
},true);
});

- -ログ - -

[info] [remote] attempting to fetch form element from selector: 'form[action^="/remote.php?act=formTargetGag"]' 
[debug] [remote] Set "email" field value to spider.batman.93@mail.ru 
[debug] [remote] Set "password" field value to ********* [info] [remote] submitting form to /remote.php?act=formTargetGag, HTTP POST

私の質問は、fillSelectors で変数を使用できないのはなぜですか? 左側の部分では、右側の部分ではすべて問題ないので、ご覧のとおりです。

次のようにデータを変数に入れます。

var a = { argLoginSelectors: argLogin, argPwdSelectors: argPwd}
for(i in a)
 console.log(i+':'+a[i]);
this.fillSelectors(argFormSelector,a,true);

しかし、何も起こりませんでした。ログに同じものがあります:

[info] [phantom] Step anonymous 3/3 http://urlwebsite/ (HTTP 200) 
[info] [remote] attempting to fetch form element from selector:
'form[action^="/remote.php?act=formTargetGag"]' 
[info] [phantom] Step anonymous 3/3: done in 1950ms.

私を助けてください:)私が間違っていることは何ですか? PS私の悪い英語で申し訳ありません。

4

0 に答える 0