저는 CasperJS를 사용하여 채우기 위해 양식을 가지고 있습니다. 코드 자체에 문제가없는 것 같습니다 (오류가 반환되지 않음). 그러나 양식이 채워 졌는지 '확인'할 수없는 것 같습니다.CasperJS & jQuery로 양식을 작성했는지 확인 할 수 없습니다.
'first_name'을 덤프 할 때 공백으로 표시됩니다. 'Joe'문자열로 채워지도록 설정 했더라도 - 내가 뭘 잘못하고 있는지 아이디어가 있습니까?
casper.start(url);
casper.then(function() {
this.fill('form[name="phones_display"]', {
'first_name' : 'Joe', // Required
'last_name' : 'bloggs', // Required
'check_payable' : '', // name to cheque if different from your name
'payment_method' : 'check', // Required check, paypal
'shipping_method' : '', // envelope, fedex
'email_address' : '[email protected]', // Required
'paypal_email_address' : '',
'telephone_number' : '12345678', // Required
'street_address_1' : '', // Required
'street_address_2' : '',
'city' : '', // Required
'state' : '',
'zip_code' : '', // Required
'hear' : '',
'otherreason' : ''
}, true);
});
casper.then(function() {
var first_name = this.evaluate(function() {
return $('input[name="first_name"]').val();
});
require('utils').dump(first_name);
});
casper.run();
감사 :-(일을하려고하지 않습니다 그래서 양식 태그를 엉망으로하고있다 ... 그것을 알아 냈다 shot :) – Zabs
어떤 이유로 든 작동하지 않는 것 같습니다. jsfiddle의 전체 js 코드입니다. http://jsfiddle.net/SD3VR/ – Zabs