public async Task <TwitterUserModel> GetUserProfileAsync(string username) { var htmlDoc = await HtmlLoader.TryLoadAndParsePageAsync($"https://twitter.com/{username}?lang=en", GetRandomProxy()); if (htmlDoc != null) { if (HtmlExtracter.TryParseUser(htmlDoc, out var user)) { return(user); } } return(null); }
public async Task <TwitterFollowPageModel> GetFollowerAsync(string username, string cursor = "-1") { var url = AddressLocator.Follower(username, cursor); var htmlDoc = await HtmlLoader.TryLoadAndParsePageAsync(url, GetRandomProxy(), false, false); if (htmlDoc != null) { if (HtmlExtracter.TryParseFollower(htmlDoc, out var followerPage)) { followerPage.BelongUserName = username; return(followerPage); } } return(null); }