Rのselectorgadgetを使用して特定のウェブサイトからデータをウェブスクラップしようとしました。たとえば、前にhttp://www.dotabuff.com/heroes/abaddon/matchupsからwebscrapedしました。通常、selectorgadget Chrome拡張機能を使用してテーブルをクリックし、CSS Selection結果を次のようにコードに挿入します。この場合R(rvest)でselectorgadgetを使用して.dpboxテーブルをwebscrapeするにはどうすればよいですか?
urlx <- "http://www.dotabuff.com/heroes/abaddon/matchups"
rawData <- html_text(html_nodes(read_html(urlx),"td:nth-child(4) , td:nth-child(3), .cell-xlarge"))
、html_nodes機能は、私はこのコードであることが判明selectorgadgetを用いhttp://www.dotapicker.com/heroes/Abaddonをオフwebscrapeしようとすると、しかし、ノード(340)
{xml_nodeset (340)}
の全体の束を返すし:
urlx <- "http://www.dotapicker.com/heroes/abaddon"
rawData <- html_text(html_nodes(read_html(urlx),".ng-scope:nth-child(1) .ng-scope .ng-binding"))
は残念ながら、ノードが実際に関数が呼び出されたhtml_nodes後に現れていない、と私は結果を得る
私はこれがドロップダウンボックスでテーブルを入れ子にすることと関係があるように感じています(前のテーブルと比べて、テーブルはウェブページ自体の上にありました)が、私はそれを回避する方法がわかりません。
ありがとう、何か助けていただきありがとうございます!