简体   繁体   中英

How to automate InternetExplorer with clojure-clr?

I'd like to use IE to open a web-page and retrieve its content from clojure-clr. I tried to translate the following C#-snippet to clojure, but could not load the DLL necessary to use SHDocVw (I don't have my clojure-code at hand right now):

using SHDocVw;
public void OpenBrowser(string url)
{ 
object o = null;
SHDocVw.InternetExplorer ie = new
SHDocVw.InternetExplorerClass();
IWebBrowserApp wb = (IWebBrowserApp) ie;
wb.Visible = true;
//Do anything else with the window here that you wish
wb.Navigate(url, ref o, ref o, ref o, ref o);
}

How would I go about accessing IE from clojure?

You need to load the dll explicitly in your clojure script, by calling Assembly.Load. This is true if you want to use anything that is not in System or in clojure.core (as those are loaded automatically).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM