开发者

Crawler, relative path to absolute path

开发者 https://www.devze.com 2023-01-12 19:29 出处:网络
I am trying to fetch pages using \"httpwebrequest\", but the links also have relative path in them like (.../something/, ../.../something/) , i am trying to map them to absolute path, i am not too goo

I am trying to fetch pages using "httpwebrequest", but the links also have relative path in them like (.../something/, ../.../something/) , i am trying to map them to absolute path, i am not too good at programming, do we开发者_Go百科 have any utility helpers to do the job, any links, articles, tutorials appreciated.

Thank you in advance.


var base = new Uri("http://stackoverflow.com/a/b/c/d.html");
var relative = new Uri(base, "../e.html"); // http://stackoverflow.com/a/b/e.html

Uri(Uri, String)
Uri.AbsolutePath

0

精彩评论

暂无评论...
验证码 换一张
取 消