c# - An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set -
i trying content web page using code :
httpclient http = new httpclient(); var response = await http.getbytearrayasync("www.nsfund.ir/news?p_p_id=56_instance_tvzmolp4zfgh&_56_instance_tvzmolp4zfgh_mode=news&_56_instance_tvzmolp4zfgh_newsid=3135919&p_p_state=maximized"); string source = encoding.getencoding("utf-8").getstring(response, 0, response.length - 1); source = webutility.htmldecode(source); htmldocument resultat = new htmldocument(); resultat.loadhtml(source);
but error :
an invalid request uri provided. request uri must either absolute uri or baseaddress must set.
you need specify full url ( including protocol) this:
var response = await http.getbytearrayasync("http://www.nsfund.ir/news?p_....
ReplyDeleteThanks, this is generally helpful.
Still, I followed step-by-step your method in this selenium online training
selenium certification
selenium online courses
learn selenium online