class SearchFighterScraper (View source)

The SearchFighterScraper class is responsible for scraping search results for fighters from Sherdog based on a given name.

It uses an HTTP client to fetch the HTML content of the search results page.

Example usage: $httpClient = new DefaultHttpClient(); $scraper = new SearchFighterScraper($httpClient); $searchResultsHtml = $scraper->search('Fighter Name'); // $searchResultsHtml will contain the HTML content of the search results page for the given fighter name

Methods

__construct(HttpClientInterface $http)

SearchFighterScraper constructor.

string
search(string $name)

Scrape search results for fighters from Sherdog based on the given name.

Details

__construct(HttpClientInterface $http)

SearchFighterScraper constructor.

Parameters

HttpClientInterface $http

An HTTP client for fetching HTML content.

Scrape search results for fighters from Sherdog based on the given name.

Parameters

string $name

The name of the fighter to search for.

Return Value

string

The HTML content of the search results page for the given fighter name.