C#今日头条推荐新闻爬取

List toutiaolist;
var request = (HttpWebRequest)WebRequest.Create(“https://www.toutiao.com/api/pc/feed/?min_behot_time=0&category=all&utm_source=toutiao&widen=1&tadrequire=true”);
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
JObject jo = JObject.Parse(responseString);
toutiaolist = JsonConvert.DeserializeObject(jo[“data”].ToString());

public class toutiaoModel
{
    public string media_avatar_url { get; set; }
    public string tag_url { get; set; }
    public string title { get; set; }
    public string source_url { get; set; }
    public string source { get; set; }
    public string item_id { get; set; }

    public string behot_time { get; set; }
    public string content { get; set; }
    public string chinese_tag { get; set; }

}            

你可能感兴趣的:(代码日常)