public async Task <IEnumerable <OhneMaklerProperty> > GetObjects(OhneMaklerClientOptions options) { var properties = new List <OhneMaklerProperty>(); var rawPage = await GetRawPage(options, 1); var pageCount = GetPageCount(rawPage); properties.AddRange(ParseHtml(rawPage)); for (int pageNr = 2; pageNr <= pageCount; pageNr++) { rawPage = await GetRawPage(options, pageNr); properties.AddRange(ParseHtml(rawPage)); } return(properties); }
private async Task <string> GetRawPage(OhneMaklerClientOptions options, int pageNr) { return(await _client.GetStringAsync($"https://www.ohne-makler.net/immobilie/list/?page={pageNr}&class={options.ObjectType}&marketing={options.MarketingType}&q={options.Location}&radius={options.Radius}&state={options.StateId}")); }