IE8 CSS Selectors in C#

  • Thread starter Thomas Zapf-Schramm
  • Start date
T

Thomas Zapf-Schramm

IE8 implements the W3C Selectors API. With this API javascript can
select elements from the DOM tree in a very comfortable way. With the
mshtml.dll the IElementSelector and IDocumentSelector interfaces make
functions querySelector() and querySelectorAll() accessible from C++ and
VisualBasic (VBA). But I can find no way to use them from C# or VB.NET.
After referencing the mshtml.tbl the Interfaces don't show up. Is there
solution to this problem?

Thomas
 
I

Ignacio Machin ( .NET/ C# MVP )

IE8 implements the W3C Selectors API. With this API javascript can
select elements from the DOM tree in a very comfortable way. With the
mshtml.dll the IElementSelector and IDocumentSelector interfaces make
functions querySelector() and querySelectorAll() accessible from C++ and
VisualBasic (VBA). But I can find no way to use them from C# or VB.NET.
After referencing the mshtml.tbl the Interfaces don't show up. Is there
solution to this problem?

Thomas

most probably because mshtml is not a COM but a native dll (although I
find this weird). What is what you want to do?
 
T

Thomas Zapf-Schramm

Ignacio said:
most probably because mshtml is not a COM but a native dll (although I
find this weird). What is what you want to do?

I'm trying to simplify a webscraping application.
So I have to figure out how do it with P/Invoke DLLImport :-(
 
T

Thomas Zapf-Schramm

Thomas said:
I'm trying to simplify a webscraping application.
So I have to figure out how do it with P/Invoke DLLImport :-(
I can't find out how to do this. Has anybody an idea or knows how to do it?
 
T

Thomas Zapf-Schramm

Thomas said:
I can't find out how to do this. Has anybody an idea or knows how to do it?
Finally it works! I had to create a new interop assembly from the IE8
mshtml.tlb with tlbimp.exe (from the WIN 6.0A SDK). Now C# sees the new
Interfaces.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top