Retrieve base URL path to be used in download image, CSS and javascript files from web page

我的未来我决定 提交于 2019-12-13 19:51:30

问题


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:


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



来源:https://stackoverflow.com/questions/1946111/retrieve-base-url-path-to-be-used-in-download-image-css-and-javascript-files-fr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!