根据@harold的建议
string page = wc.DownloadString("https://www.youtube.com/browse_ajax?action_continuation=1&continuation=4qmFsgI8EhhVQ2ZXdHFQeUJNR183aTMzT2VlTnNaWncaIEVnWjJhV1JsYjNNZ0FEQUJPQUZnQVdvQWVnRTB1QUVB");
int pos;
while ((pos = page.IndexOf("/watch?v=")) > 0) {
int subPos=pos;
subPos=page.IndexOf("video-time",subPos);
subPos=page.IndexOf("aria-label",subPos);
subPos=page.IndexOf(@"\u003e",subPos);
subPos+=6;
string vt=page.Substring(subPos,(subPos=page.IndexOf(@"\u003c",subPos)));
subPos=page.IndexOf("title=",subPos);
subPos++;
subPos=page.IndexOf("title=",subPos);
subPos++;
subPos=page.IndexOf("title=",subPos);
subPos=page.IndexOf("\\\"",subPos);
subPos+=2;
string tt=page.Substring(subPos,(subPos=page.IndexOf("\\\" aria-describedby=", subPos)));
page=page.Substring(subPos);
}
似乎比使用
StringBuilder
具有
ToString()