0
In c# I will develop an application to control views and subscribers of my channel...
I tried to enter this code:
static long Inscritos(string youtube_addr){
var wb=new WebBrowser();
wb.Navigate(youtube_addr); // Sendo http://youtube.com/user/meu_canal/about
var countAll = wb.Document.getElementsByTagName('b')[0];
retun Convert.ToInt64(countAll);
There at the time I call MessageBox.Show(Inscritos('http://youtube.com/user/malena010102/about').ToString());
the result is a blank text!
You’re picking up the contents of a tag bold? The first page is the counter? You know this is pretty unreliable? Youtube doesn’t have an official API? If you want to insist on this, consider taking tag with class
about-stat
and within it take what is in<b>
. But I think this kind of class you’re using doesn’t allow it directly. Then you’d have to hunt, there might be ambiguity. That is, it is not easy to succeed. Maybe this helps: http://htmlagilitypack.codeplex.com/– Maniero
https://developers.google.com/youtube/v3/docs/subscriptions/list
– Maniero