waiyan93 / web-scraping

0 stars 0 forks source link

Extracting the Scraping to a Service class #12

Open olivierobert opened 2 years ago

olivierobert commented 2 years ago

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.

waiyan93 commented 2 years ago

Yeah sir. I will abstract that logic into a class. So that I can manage it easily.