我正在尝试通过提交此表单here
来获取数据点击“城镇”将出现一个表格。
虽然我可以获取数据,但它是500个错误页面,我已经挣扎了5个小时和我的代码
$url = 'http://services2.hdb.gov.sg/webapp/BR12AWRentalEnquiry/BR12PSearch.faces';
$fields['searchByTown:frmSearchByTown']='searchByTown:frmSearchByTown';
$fields['searchByTown:frmSearchByTown:selTown']='AMK';
$fields['searchByTown:frmSearchByTown:txtBlkFrm']=1;
$fields['searchByTown:frmSearchByTown:txtBlkTo']=10;
$fields['searchByTown:frmSearchByTown:dteStart1']="Jul 2013";
$fields['searchByTown:frmSearchByTown:dteEnd1']="Oct 2013";
$fields['avax.faces.ViewState']='j_id1:j_id3';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POST ,1);
curl_setopt($ch, CURLOPT_POSTFIELDS ,$fields);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER ,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);
$data = curl_exec($ch);
curl_close($ch);
有人发现了这个问题吗?