Similarly to #8, ScrapeGoolgeSearchResult contains too much business logic, hence is hard to test. With #9, the class can be simplified by calling a new instance of a service class that would contain the scraping logic. $host and $userAgents could be defined as class attributes instead of config variables or local variables.
Expected
ScrapeGoolgeSearchResult does not contain the web scraping logic.
Issue
Similarly to #8,
ScrapeGoolgeSearchResult
contains too much business logic, hence is hard to test. With #9, the class can be simplified by calling a new instance of a service class that would contain the scraping logic.$host
and$userAgents
could be defined as class attributes instead of config variables or local variables.Expected
ScrapeGoolgeSearchResult
does not contain the web scraping logic.