开发者

php curl fail-over function for "couldn't connect to host"

I have a php curl script which crawls different websites . The problem is that after a while I think the websites place a kind of temporary ban on my IP and the script is unable to connect to the host anymore(as I'm getting "couldn't connect to host" erro开发者_JAVA百科r) . I would like to set a condition/function to make the script stop for a while (e.g sleep(30)) but I don't know how to detect(handle the error) when cURL is unable to connect to the host.


php.net/curl_errno

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜