5
使用以下documentation我一直在試圖從marketwatch.com如何用rvest和xpath擦一張桌子?
這裏颳了一系列的表格,是波紋管的代碼所表示的一個:
鏈接和XPath已經包含在代碼:
url <- "http://www.marketwatch.com/investing/stock/IRS/profile"
valuation <- url %>%
html() %>%
html_nodes(xpath='//*[@id="maincontent"]/div[2]/div[1]') %>%
html_table()
valuation <- valuation[[1]]
我得到以下錯誤:
Warning message:
'html' is deprecated.
Use 'read_html' instead.
See help("Deprecated")
在此先感謝。
刪除'html()'並替換爲'read_html()' – cory
這不是一個錯誤,這是一個警告。您的代碼仍然會以該警告運行。 – SymbolixAU
謝謝。固定。 –