简体   繁体   English

如何使用clojure-clr自动执行InternetExplorer?

[英]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. 我想使用IE打开网页并从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): 我试图将以下C#代码片段转换为clojure,但无法加载使用SHDocVw所需的DLL(我现在没有我的clojure代码):

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? 我将如何从clojure访问IE?

You need to load the dll explicitly in your clojure script, by calling Assembly.Load. 您需要通过调用Assembly.Load在clojure脚本中显式加载dll。 This is true if you want to use anything that is not in System or in clojure.core (as those are loaded automatically). 如果您要使用System或clojure.core中没有的任何内容(因为这些内容是自动加载的),则为true。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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