I'm trying to make an app, which could open a pdf file in a browser (Chrome) and search for a certain word automatically. However, I can't find anything about passing commands to Google from C# whatsoever.
Process process = new Process();
process.StartInfo.UseShellExecute = true;
process.StartInfo.FileName = "chrome";
process.StartInfo.Arguments = "console.log(\"TEST1\")";
process.Start();
I've tried running Chrome with StartInfo.FileName = "chrome"
, which went well. After that I thought I could add some Arguments: StartInfo.Arguments = "something"
and that's where I ran into two problems:
- The browser takes the Arguments as a URL and tries to open it as a web page (which of course fails)
- I couldn't find the console command to run the search function in Chrome
Is there maybe some google API capable of this thing? Also please note that I'm not trying to use "search". I need the browser to literally focus on the word it found
If anyone here knows how to solve even one of these problems, I would be really grateful. Also this is my first question on StackOverflow (and I might have forgotten something) - I can give some additional info, if you ask