DOMDocument xpath 查询在特定时间范围内中断?
有没有办法切断查询并返回结果.. 预设从给定网址获取所有图像所需的时间.. 即查询网页的一半?或者工作时间不超过5秒,因此,它将在5秒内得到它能得到的一切......
$xpath = new DOMXPath( $htmlget);
$nodelist = $xpath->query( "//img/@src" );
is there a way to cut of the query and return back the results.. preset time to take to get all images from the given url .. i.e. query half of the webpage ? or job time not greater than 5 seconds, so therefore, it will get everything it can in 5 seconds.....
$xpath = new DOMXPath( $htmlget);
$nodelist = $xpath->query( "//img/@src" );
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以单独逐一评估以下任何 XPath 表达式,并在计时器到期或满足其他条件时停止此过程:
这可能可以通过分块来加速:
You can evaluate separately any of the following XPath expressions one by one, and stop this process whenever a timer expires or other criterion is satisfied:
This can probably be speeded-up by chunking: