我尝试使用selenium webdriver 2.37使用下面的代码向下滚动网页,但它似乎无法正常工作。
<?php
require_once('lib/__init__.php');
$host = 'http://localhost:4444/wd/hub'; // this is the default
$capabilities = array(WebDriverCapabilityType::BROWSER_NAME => 'firefox');
$driver = RemoteWebDriver::create($host, $capabilities,1000);
$driver->get('https://twitter.com/hashtag/DF14?src=hash');
$driver->getKeyboard()->pressKey(WebDriverKeys::ARROW_DOWN);
sleep(rand(5,7));
?>