私はGoutte、https://github.com/fabpot/goutteを使用しており、次のコードがあります。
$client = new Client();
$crawler = $client->request('GET', \Config::get('Eload2::url'));
$form = $crawler->selectButton('Submit')->form();
// add extra fields here
$client->submit($form);
フォームを送信する前に非表示の入力フィールドをフォームに追加するにはどうすればよいですか?
私は次のコードを試しました、
$domdocument = new \DOMDocument;
$formfield = new InputFormField ($domdocument->createElement('__EVENTTARGET', 'ctl00$ContentPlaceHolder1$DDLTelco'));
$formfield2 = new InputFormField ($domdocument->createElement('__EVENTARGUMENT',''));
$form->set($formfield);
$form->set($formfield2);
しかし、次のエラー メッセージが返されます。
InputFormField は、入力タグまたはボタン タグ (__EVENTTARGET が指定されている) からのみ作成できます。