1

We are downloading web page linked Images, style sheet(.css) and javascript files using web browser control (IWebbrowser2 and IHTMLDocument interface) ATL win32 application.

Now for some of the web page image src= "/images/a1.jpg" are relative, so we need to append a base host address to the location and download.

Do we have any method to get the base host address URL path to be append into image path. or any good parser to extract that?

Thanks, Ramanand Bhat.

1 Answer 1

3

Does IWebBrowser2::LocationURL or IHTMLDocument2::URL not give you the base URL you need?

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, it gives the complete browsed URL path, so from their we have to parse the base root location URL, which we are trying to avoid.
The use something like the UrlCombine function. If you pass it the base URL of say domain.com/somepath/something.htm and a relative path of /images/image.jpg it will return domain.com/images/image.jpg

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.