문제

Get a page using the httpWebRespond check the received text with the debugger and see that the links are not complete, i.e. If the code of page look in firefox like

<a href = "http:\www.server.ru\mainpage.asp"> </a>

but after getting html page by GetResponseStream () I see the following

<a href = "mainpage.asp "> </a>.

How did receive a response full of links?

도움이 되었습니까?

해결책

Yout don't. Relative url's are perfectly acceptable per the RFCs. They are to be interpreted by the User Agent (that's you) as relative to the current url (that being the URL you retrieved whose content returned the relative URLs.)

You need to make them relative to that URL, so a relative URL like foobar.html on a page whose full URL is http://somedomain/alpha/bravo/charlie/index.html gets converted to http://somedomain/alpha/bravo/charlie/foobar.html.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top