views:

46

answers:

1

Hi,

Sory for the title and the topic, I didn't really know where to put my question :) . I'm looking for a way to automatically get the HTML source of an openned page in firefox so I can use it in a C# application. For example, I would browse a page in firefox. When I would like to get some data I would start my program and refresh the page in firefox. The program would get the HTML source and extract data. Kinda like clicking the "show source" in firefox, using Ctrl+a and pasting the source into my C# application, but I want to automate this step. I hope there is another way than to writing my own firefox extension, I never did that before and it would take long for me. Too long just to get the source.

I'm already using Greasemonkey, so I could write a script that automatically saves the source to a file from which my application could read the whole source. But that wouldn't be effective. Unless there is another way to connect to the firefox page via javascript, that won't work.

Ok, to put it short : which way is the best to automatically get the HTML source of an opened page in firefox to my C# application?

I'm gratefull for any answers :)

+2  A: 

Does it have to be firefox? The IE browser functions integrate pretty well and easy with windows forms .NET applications. Is something like that a good idea for you? (check out the WebBroweser.Document property at http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.document(v=VS.85).aspx)

Martijn