2011-10-27 8 views
0

選択した領域(の長方形)のブラウザからhtmlソース(全要素)を取得する方法はありますか? ありWebBrowser.Document.GetElementFromPointですが、それが意味するだろう、私は...文書全体をループに事前にエリアからhtml要素を取得する

感謝を持って

+0

どのように選択したエリアを意味しますか?どのように選んだの? – Oded

+0

あなたは[HTML Agility Pack](http://htmlagilitypack.codeplex.com/)を調べましたか? – Jetti

答えて

0

現在のドキュメント内のすべての要素を取得するために...このようにしてみてください

// start an instance of IE 
public SHDocVw.InternetExplorerClass ie; 
ie = new SHDocVw.InternetExplorerClass(); 
ie.Visible = true; 

// Load a url 
Object Flags = null, TargetFrameName = null, PostData = null, Headers = null; 
ie.Navigate(url, ref Flags, ref TargetFrameName, ref PostData, ref Headers); 

while(ie.Busy) 
{ 
    Thread.Sleep(500); 
} 

// get an element from the loaded document 
mshtml.HTMLDocumentClass document = ((mshtml.HTMLDocumentClass)ie.Document); 
document.getElementById("myelementsid"); 
+0

私はdocument.getElementsFromArea(新しいRectangle(0,0,100,100)))のようなものを意味しました。 –

関連する問題