FightsScraper
class FightsScraper (View source)
The FightsScraper class is responsible for scraping fight details from a given URL and returning an array of FightDTOs.
It uses an HTTP client to fetch the HTML content and a parser to extract the relevant information.
Example usage: $httpClient = new DefaultHttpClient(); $parser = new ParseFights(); $scraper = new FightsScraper($httpClient, $parser); $fights = $scraper->scrape('https://www.blackcombat.com/event/123/fights'); // $fights will contain an array of FightDTOs with the scraped fight details
Methods
array
scrape(string $url)
Scrape fight details from the given URL and return an array of FightDTOs.
Details
__construct(HttpClientInterface $http, ParseFights $parser)
FightsScraper constructor.
array
scrape(string $url)
Scrape fight details from the given URL and return an array of FightDTOs.