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->scrapeById(123); // $fighterDTO will contain the scraped fighter details for the fighter with ID 123
Methods
scrapeById(int $id)
Scrape fighter details by Sherdog ID and return a FighterDTO.
Details
__construct(HttpClientInterface $http, ParseFighter $parser)
FighterScraper constructor.
FighterDTO
scrapeById(int $id)
Scrape fighter details by Sherdog ID and return a FighterDTO.