获取下载的Google搜索网站的特定链接

问题描述

我想在C#中执行以下操作:

  1. 后台加载网站(谷歌搜索网站)
  2. 查看该网站的源代码获取特定链接

我之前尝试过此操作

  1. 使用WebClient类下载网站的字符串
WebClient client = new WebClient();
string reply = client.DownloadString(url);
client.DownloadFile(gesamter_String,@"C:\neu\localfile.html");
Console.WriteLine(reply);
  1. 使用HTTPClient类下载网站的字符串
string url = hyperlink;
HttpClient client = new HttpClient();

using (HttpResponseMessage response = client.GetAsync(url).Result)
   {
     using (HttpContent content = response.Content)
     {
      string result =content.ReadAsstringAsync().Result;
                    
       Console.WriteLine(result);
     }
  }

但是下载或显示的源代码很小,并且不包含特定的链接

但是我的链接有效。我已使用以下链接打开了前台链接System.Diagnostics.Process.Start(url);。这个前台打开的站点包含完整的源代码

非常感谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)