我的 C# .NET Core 控制台应用程序是一个简单的网络爬虫。在源代码中包含所需数据的页面上,我能够访问所需数据。在可以从窗口复制数据的页面中,在浏览器的页面检查器中查看,但不在源代码中,我被卡住了。
请提供我如何获取这些数据的代码示例。
我当前的捕获代码如下:
var htmlCode = string.empty;
using (WebClient client = new WebClient()) // WebClient class inherits IDisposable
{
// Get the file content without saving it
htmlCode = client.DownloadString("https://www.wedj.com/dj-photo-video.nsf/firstdance.html");
}
使用上面的代码,您会收到如下所示的源代码:
从浏览器检查器中看到的图 1 中显示的数据隐藏在
<div class="entry row">
呼啦一阵风
凤凰求蛊
小唯快跑啊
相关分类