public async Task <bool> LoadNextPage() { if (this._isLastPage) { return(false); } var url = string.Format(UrlTemplate, this._count, new Random().Next().ToString()); using (var response = await this._client.PostAsync(url, new FormUrlEncodedContent(this._parameters))) { CQ page = await response.Content.ReadAsStringAsync(); this.Characters = page.GetCharacters(ref this._count).ToArray(); var nextBtn = page[".btn_pager_next"]; this._isLastPage = nextBtn.Length == 0 || nextBtn.HasClass("_hover"); } return(true); }
public async Task <bool> LoadNextPage() { if (this._isLastPage) { return(false); } var url = string.Format(UrlTemplate, this._count, new Random().Next().ToString()); var p = await this._client.GetStringAsync(url); CQ page = p; this.Characters = page.GetCharacters(ref this._count).ToList(); var nextBtn = page[".btn_pager_next"]; this._isLastPage = nextBtn.Length == 0 || nextBtn.HasClass("_hover"); return(true); }