0

I want to know if I will be able to control a web browser using a C# program. What I want to do is the following:

I want to create a windows desktop application which will allow me to Open a web-browser (google chrome), input a webpage address, go to a web page, type something in a specific field or click something.

All of the above would have to be done automatically by the C# application without any user intervention after he opens up the application.

I want to know is it possible doing it in C# ? and if it isn't I would like some suggestions guiding me how would I go about creating this app, what programming language should I take a a look at or what should I research.

I only want a guidance for how I should go about creating this application.

Thanks to anyone who is going to answer ;)

Shady Programmer
  • 794
  • 4
  • 9
  • 22
  • what is the ultimate goal? maybe the site you are trying to work with has api and you don't need to do that through a browser. Which will make the task easier and implementation more robust. – trailmax Jan 25 '14 at 13:11
  • The ultimate goal is using google chrome open up google.com click on speech recognition [the user then speaks] and then take the searched phrase for further processing. I'm looking forward to your feedback – Shady Programmer Jan 25 '14 at 15:12
  • Before going with hacky approach of browser controlling, I'd research on Google Voice API. Can start here: http://stackoverflow.com/questions/6389039/how-google-voice-search-works-is-there-an-api-for-that – trailmax Jan 25 '14 at 15:26
  • Thank you good sir you have saved me a lot of trouble! I found that to be able to use google speech recognition I only have to add x-webkit-speech element to the textboxes which I create in HTML5 which is great! I've created my own HTML document and speech recognition works great, I still have to figure out a way of taking the converted speech-to-text from the HTML to my own desktop application, but I think I'll be able to do that by Selenium in which I've been experimenting now. – Shady Programmer Jan 25 '14 at 21:53
  • that's a long way to go for a speech recognition in desktop app. Have a look on this http://msdn.microsoft.com/en-us/library/hh361683(v=office.14).aspx – trailmax Jan 25 '14 at 22:00
  • Thanks to your answer I found out that I can create a C# application with windows recognition so I have two options now either go with the long way of using googles speech recognition or programming my own with C#. Now the question is which will be more reliable (producing better speech-to-text results) and efficient ? – Shady Programmer Jan 25 '14 at 22:50
  • I don't know. I've never done such task. But it seems like a cludge to create a browser inside of desktop application, use speech recognition there and parse html to get results. I'd rather use native C# from the start - more reliable in terms of dependencies. But I'd guess Google Voice would have a better recognition – trailmax Jan 25 '14 at 23:16
  • If you could give me your e-mail I'd send you a video of it – Shady Programmer Feb 14 '14 at 18:17

1 Answers1

2

There are a few possibilities to achieve this:

Paweł Bejger
  • 6,176
  • 21
  • 26
  • Hey "bejger" the selenium option looks very promising to me! I have researched a bit about it and it seems that it is what I wanted and it can be embedded into microsoft visual studio for coding in C# which is great! Do you know any problems or any hardship that I can experience if I go with this option ? – Shady Programmer Jan 25 '14 at 15:05
  • Not to my knowledge - we use Selenium in our company for already a a few years and we are very happy about this :) Until now we haven't faced any serious problems or hardhips – Paweł Bejger Jan 25 '14 at 15:19
  • Google Chrome extensions can also use [Native Messaging](https://developer.chrome.com/docs/apps/nativeMessaging/) to receive commands from desktop applications. – Anderson Green Jan 07 '22 at 17:30