teşekkür ederim sitenin içeriğe erişebiliyorum fakat ekran resmini bulamıyor. resim dosyalarıma gelmiyor
<?php
namespace App\Console\Commands;
use Illuminate\Support\Facades\Storage;
use Illuminate\Console\Command;
use Spatie\Browsershot\Browsershot;
class CaptureScreenshots extends Command
{
protected $signature = 'capture:screenshots';
protected $description = 'Capture screenshots of websites with Tor proxy';
public function handle()
{
$url = 'https://check.torproject.org';
$filename = uniqid() . '.png';
$screenshotPath = storage_path('app/public/screenshots/');
$proxy = 'socks5://127.0.0.1:9050';
try {
Browsershot::url($url)
->setOption('args', ['--proxy-server=' . $proxy, '--location'])
->waitForSelector('title', ['timeout' => 60000])
->screenshot($screenshotPath . $filename);
$pageTitle = Browsershot::url($url)
->setOption('args', ['--proxy-server=' . $proxy, '--location'])
->evaluate('document.title');
$this->info('Page Title: ' . $pageTitle);
if (Storage::disk('public')->exists('screenshots/' . $filename)) {
Storage::disk('public')->put('screenshots/' . $filename, file_get_contents($screenshotPath . $filename));
unlink($screenshotPath . $filename);
$this->info('Screenshot saved as: screenshots/' . $filename);
} else {
$this->error('Screenshot not found at ' . $screenshotPath . $filename);
}
} catch (\Exception $e) {
$this->error('Error: ' . $e->getMessage());
}
}
}
**PS C:\Users\nopi\Desktop\scraper> php artisan capture:screenshots
Page Title: Congratulations. This browser is configured to use Tor.
Screenshot not found at C:\Users\nopi\Desktop\scraper\storage\app/public/screenshots/677e684dde271.png
PS C:\Users\nopi\Desktop\scraper>**