我想从网络上获取标题和描述。我用
var title= (from item in doc.DocumentNode.SelectNodes(
"//div[@class='section sectionMain recentNews']//a[@class='newsTitle']")
select item).ToList();
var des= (from item in doc.DocumentNode.SelectNodes(
"//div[@class='section sectionMain recentNews']//div[@class='newsText']")
select item).ToList();
现在,我想使用查询选择所有标题,描述如下:
var data = (from item in doc.DocumentNode.SelectNodes(
"//div[@class='section sectionMain recentNews']") select new
{
title =..........., description =.......
}