Zak*_*rki 6 php selenium curl facebook webdriver
当我尝试使用以下代码连接到任何具有代理的网站时,我正在使用facebook/php-webdriver:
$driver = RemoteWebDriver::create($host, $capabilities);
try{
$driver->navigate()->to("http://www.example.com/");
} catch (Exception $e) {
echo $e->getMessage();
}
Run Code Online (Sandbox Code Playgroud)
这需要时间,因为代理有时很慢,然后返回以下错误:
使用params:{"url":"http://www.live.com/"}将http POST引发到/ session/c189e325-9057-489c-b2de-93c95cdb1cc4/url的卷曲错误
操作在30001毫秒后超时,接收到0个-1字节
问题:可以增加卷曲时间延迟30001毫秒?
iai*_*inn 21
RemoteWebDriver::create() 支持指定连接和请求超时,例如
$driver = RemoteWebDriver::create(
$host,
$capabilities,
60 * 1000, // Connection timeout in miliseconds
60 * 1000 // Request timeout in miliseconds
);
Run Code Online (Sandbox Code Playgroud)
请参阅:https://github.com/facebook/php-webdriver/blob/community/lib/Remote/RemoteWebDriver.php#L67
| 归档时间: |
|
| 查看次数: |
3452 次 |
| 最近记录: |