[R] 利用R下載網頁上的檔案

最近用網路爬蟲,
赫然想到是否可以直接用R下載檔案,
發現真的有相關函式,
就是download.file
你可以給他網址,
並且設定檔案名稱,
即可將檔案下載下來,
配合網路爬蟲抓取多個URL即可自動化下載多個檔案了(?)。
下面有程式碼範例。

When I was using crawler,
I found a interesting function called download.file.
You give it the url of the file you want to download,
and give it a file name.
Then you can download the file with this function.
I think download.file can coordinate with crawler,
and download many files automatically.

沒有留言:

張貼留言