diff --git a/storage/app/NewCrawler2024.php b/storage/app/NewCrawler2024.php new file mode 100644 index 0000000..4d4dcbc --- /dev/null +++ b/storage/app/NewCrawler2024.php @@ -0,0 +1,63 @@ +client = Client::createSeleniumClient( + 'http://localhost:'.config('app.selenium_grid_port').'/wd/hub' + ); + } + + /** + * @return void + */ + private function getInput() { + $words = $this->ask('>>'); + $this->info($words); + } + + /** + * Execute the console command. + * + * @return int + */ + public function handle() + { + $this->client + ->get('https://www.imdb.com/search/name/?birth_monthday=12-10'); + $crawler = $this->client->getCrawler(); + $preferences = $crawler->filterXPath('//button[@data-testid="accept-button"]'); + $preferences->click(); + $element = $crawler->filterXPath('//h3[text()="1. Kenneth Branagh"]'); + $element->click(); + $this->client->takeScreenshot($saveAs = 'screenshot.jpg'); + + return 0; + } +}