dpdp42233 2013-01-23 08:33
浏览 4
已采纳

未找到卷曲元素错误

I am stuck in a situation when I get content of a web page through CURL then I received page content but got error query result not present there. I always got element not found error.

But when I put URL in browser then got appropriate result. How can I resolve that?

URL I am using is http://164.100.9.38/judis/handle/123456789/30346/simple-search?query=%28%28petitioner:ajay%29%29&from_advanced=true&query11=&query9=&query8=&conjunction8=AND&conjunction9=AND&query10=&conjunction6=AND&conjunction7=AND&field5=judge&field4=petitioner&field3=respondent&field2=caseyear&field9=abstract&field8=type&field7=datejudgement&conjunction10=AND&field6=headnotes&query4=ajay&query5=&query6=&query7=&field1=casenumber&query1=&query2=&query3=&conjunction3=AND&conjunction2=AND&conjunction5=AND&conjunction4=AND&field10=citation&conjunction1=AND&field11=keyword&num_search_field=11

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • dongping9475 2013-01-23 08:59
    关注

    You need to login on the site first or create a session first. They are using session. Surprisingly they are providing session id on page http://164.100.9.38/judis/styles.css.jsp.

    So request http://164.100.9.38/judis/styles.css.jsp first. It'll set the cookie. And then request your usual way.

    To keep your session cookies use CURLOPT_COOKIEFILE and CURLOPT_COOKIEJAR options.

    curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
    curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 nslt的可用模型,或者其他可以进行推理的现有模型
  • ¥15 arduino上连sim900a实现连接mqtt服务器
  • ¥15 vncviewer7.0安装后如何正确注册License许可证,激活使用
  • ¥15 phython如何实现以下功能?查找同一用户名的消费金额合并2
  • ¥66 关于人体营养与饮食规划的线性规划模型
  • ¥15 基于深度学习的快递面单识别系统
  • ¥15 Multisim仿真设计地铁到站提醒电路
  • ¥15 怎么用一个500W电源给5台60W的电脑供电
  • ¥15 请推荐一个轻量级规则引擎,配合流程引擎使用,规则引擎负责判断出符合规则的流程引擎模板id
  • ¥15 Excel表只有年月怎么计算年龄