FighterScraper
class FighterScraper (View source)
The FighterScraper class is responsible for scraping fighter details from a given URL and returning a FighterDTO.
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 ParseFighter(); $scraper = new FighterScraper($httpClient, $parser); $fighterDTO = $scraper->scrape('https://www.blackcombat.com/fighter/123'); // $fighterDTO will contain the scraped fighter details
Methods
scrape(string $url)
Scrape fighter details from the given URL and return a FighterDTO.
Details
__construct(HttpClientInterface $http, ParseFighter $parser)
FighterScraper constructor.
FighterDTO
scrape(string $url)
Scrape fighter details from the given URL and return a FighterDTO.