Skip to content

Instantly share code, notes, and snippets.

@dck-jp
Created June 6, 2015 11:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dck-jp/519bf9f5acef3555b595 to your computer and use it in GitHub Desktop.
Save dck-jp/519bf9f5acef3555b595 to your computer and use it in GitHub Desktop.
SHDocVwSample10
public void ClickImage()
{
var IE = new SHDocVw.InternetExplorer();
IE.Visible = true;
object URL = "http://finance.yahoo.co.jp/";
IE.Navigate2(ref URL);
IE.Wait();
var doc = IE.Document as mshtml.IHTMLDocument3;
foreach (mshtml.HTMLImg img in doc.getElementsByTagName("img"))
{
if (img.alt == "日経平均株価") { img.click(); } //altの値を見て選択
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment