using MusicMetaTagger.Client.AllMusicGuide.RemoteDataAccess.Client;
using MusicMetaTagger.Client.AllMusicGuide.RemoteDataAccess.Parser;

namespace MusicMetaTagger.Client.AllMusicGuide.RemoteDataAccess.Scraper
{
	public abstract class ScraperBase<TEntity, TClient, TParser> : IScraper<TEntity>
		where TClient : IXmlClientBase, new()
		where TParser : IParser<TEntity>, new()
	{
		public TEntity Scrape(string criteria)
		{
			var xmlDocument = new TClient().Read(criteria);
			return new TParser().Parse(xmlDocument);
		}
	}
}