だから私はすべてのファイルと、このスクリプトセレンスタンドアロンサーバー、クロムwebdriverをとthis PHP Web Driverを使用してfile_get_contentsは、ブラウザのキャッシュされたイメージを、セレンでURLに移動すると使用しますか?
<?php
require_once('../_libTest/__init__.php');
class cacheTest
{
private $driver;
function __construct()
{
$host = 'http://localhost:4444/wd/hub'; // this is the default
//$capabilities = array(WebDriverCapabilityType::BROWSER_NAME => 'chrome');
$capabilities = DesiredCapabilities::chrome();
$options = new ChromeOptions();
/*$options->addExtensions(array(
'3.2.1_0.crx'
));*/
$capabilities->setCapability(ChromeOptions::CAPABILITY, $options);
$this->driver = RemoteWebDriver::create($host, $capabilities,86400000,86400000);
}
function run()
{
$url = "https://www.google.com.au/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png";
$this->driver->get($url);
$filename = explode("/",$url);
$filename = end($filename);
$image = file_get_contents($url);
file_put_contents($filename,$image);
//$this->driver->quit();
}
}
$app = new cacheTest();
$app->run();
?>
は、(すべての名前空間を削除するために編集した)私はChromeブラウザウィンドウを開くことができ__init__.php
ファイルに含まれていキャッシュ画像(Chromeの閲覧履歴におけるので、オプションをofternする時間ブラウザを保存するために、画像やファイルをキャッシュ」、file_get_contents
およびしかし
私は疑問に思ってfile_put_contents
を使用して、それをダウンロードして、Googleのロゴ画像のURLに移動します。 ")i ru nセレニウムを使用して画像に直接ナビゲートすると、file_get_contents
はブラウザのキャッシュされた画像を取得していますか、サーバーから新鮮な画像が得られますか?答えhereとhereによると、答えは何しかし、私の場合は、->get($url)
最初