YouTube から特定の要素 (ビデオのタイトル) を取得しようとしています。
HTML: http://pastebin.com/cjr2SgNd
重要な HTML 部分:
<span id="eow-title" class="watch-title " dir="ltr" title="Latest Agar.io PvP - Create Your Own Server!"></span>
私はこれを見つけたい:title="Latest Agar.io PvP - Create Your Own Server!"
ただし、次のエラーが表示されます: http://pastebin.com/G7x9FZaa
Jaunt を使用してタイトルを取得しています。コード:
UserAgent userAgent = new UserAgent();
//troubleshooting
System.out.println("working");
List<String> vid = userAgent.doc.findAttributeValues("<span title>");
System.out.println(vid);
//troubleshooting
System.out.println("working1");