Answer the question
In order to leave comments, you need to log in
How to make the program interact with the search engine?
I want to write a C# program that would Google me a list of films of a certain genre, but I don’t quite understand how to implement it, should the program launch the default browser and send a search query, or can I somehow bypass the browser? Or is it complete heresy and is it better to do something else?
Answer the question
In order to leave comments, you need to log in
Why use a search engine if there are specialized movie directories and they have their own API: MovieSearch
API
OMDb API
Everywhere there is a search by genre.
Launching a browser in c# is a matter of 3 mouse clicks (WebBrowser control), it will be a little more difficult to simulate the input of a request, more precisely, to find in which inputs you need to insert text and which one to click.
It is better to simulate all actions in javascript inside this browser (although it is possible to work with the DOM directly from c #, this is justified for reading, but not obvious glitches may occur in the general case for changes), launching through onTimeout with zero delay.
be prepared that a captcha may appear on the page, search engines do not like free automation bypassing their paid APIs
ps Once upon a time I made an application that made dozens of requests per minute, several Google ip addresses were used at once in turn to avoid a ban for the frequency of requests, the simulation was based on curl, that was another quest, and most importantly, it was tedious to maintain, search engines change constantly, better than what I wrote above.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question