这是我的代码:
<div class="container"><div class="row"><div class="FCpanel"><div class="mainFlex col-xs-8"><div class="box1">This is some text</div><div class="box2">some text sdjks sjkhsdkjh sk sdjks sjkhsdkjh sadk;s sjks jsdh dsk shjk</div><div class="box3">is some text sdjks sjkhsdkjh sadk;s sjks jsdh dsk shjk sdjkl fsdjkl fsjk jk sfjk fsdjk his is some text sdjks sjkhsdkjh sadk;s sjks jsdh dsk shjk sdjkl fsdjkl fsjk jk sfjk fsdjk his is some text sd sdjkl fsdjkl fsjk jk sfjk fsdjk his is some text sdjks sjkhsdkjh sadk;s sjks jsdh dsk shjk sdjkl fsdjkl fsjk jk sfjk fsdjk his is some text sdjks sjkhsdkjh sadk;s sjks jsdh dsk shjk sdjkl fsdjkl fsjk jk s some text sdjks sjkhsdkjh sadk;s sjks jsdh dsk shjk sdjkl fsdjkl fsjk jk sfjk fsdjk his is some text sdjks sjkhsdkjh sadk;s sjks jsdh dsk shjk sdjkl fsdjkl fsjk jk sfjk fsdjk his is some text sdjks sjkhsdkjh sadk;s sjks jsdh dsk shjk sdjkl fsdjkl fsjk jk sjks sjkhsdkjh sadk;s sjks jsdh dsk shjk sdjkl fsdjkl fsjk jk s</div></div><div class="mainFlex col-xs-2 col-xs-offset-1"></div></div></div></div>
简单的代码,但我不希望程序转到youtube上Textbox1.text的链接。我希望程序只是给我回搜索的链接,而不是去那里。
我想在文本框中添加一个单词,当我按下按钮时,它应该给我youtube的链接而不是去那里(就像我的程序在转到youtube链接时那样)。
无法更好地解释。希望你们能理解我想做的事。
答案 0 :(得分:1)
我假设您要检索触发查询时谷歌返回的网址。一种可能性是使用HttpClient类来检索请求,并从RequestMessage属性中检索请求的URL:
var url = "https://www.google.com/search?q=stackoverflow&btnI";
var http = new HttpClient();
var response = http.GetAsync(url);
Console.WriteLine(response.Result.RequestMessage.RequestUri.AbsoluteUri);
输出结果为:
http://stackoverflow.com/