Suppose there is a website www.youtube.com. How to send text to the search field in C #, press the “Find” button and display the name of the video containing the text after the видео= from the page?

Closed due to the fact that the essence of the question is not clear to the participants by Denis , pavel , Streletz , aleksandr barakin , user207618 Sep 9 '16 at 7:25 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    Welcome to StackOverflow. If you "really need it," take the trouble to clearly explain what you want. "there is a site www.youtube.com" - where? - Igor
  • one
    If inside UI C #, then look at the classes WebBrowser, WebRequest and WebResponse. For the rest, specify your question for a more accurate answer. - Alex Krass

1 answer 1

You should be familiar with youtube api, everything will be much easier. Search and lists, everything is there, ready-made c # libraries exist

developers.google.com/youtube/v3/code_samples/dotnet

there is a heading "Search by keyword" ready code for your question.

And if we talk about a universal tool, then you need to dig in the direction of POST and GET requests for you to learn the basics of html and the components of "webclient and http request".

In response to the request (which contains a form with input, where you put the name of the video) html will return to you with a bunch of videos, after which you will be parsing by some sign, maybe, or something like that, which will be the title, banal split [] and indexOf () you pull out the desired title. But it is better to use api.