Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

crawler for COSMED store information via rvest

Notifications You must be signed in to change notification settings

olycats/cosmed-store-list-r

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cosmed-store-list-r

使用R語言rvest套件,擷取康是美門市列表。

資料來源: 康是美門市查詢 webpage

輸出結果(csv檔): webpage

Requirements

須安裝R以及R語言的rvest套件

安裝rvest

install.packages("rvest")

若是使用Ubuntu安裝可能會出現錯誤訊息,請參考:

https://olycats.github.io/2017/11/24/ubuntu-rvest/

Code structure

cosmed-store-list
├── output
├── pages
└── screenshots

File/Folder Description
.gitignore gitignore
output 網頁爬蟲的結果,check_list.csv、shop_list.csv兩個檔案
pages 網頁html檔儲存的路徑
screenshots README.md使用的截圖
README.md README
store-list-crawler.R 網頁爬蟲的程式碼(R語言)

執行

因執行結果會將檔案輸出在目前的工作目錄, 開啟R後,請先確認目前的工作目錄是否在這個目錄(cosmed-store-list)

getwd()

若路徑錯誤,請自行設定工作目錄。

setwd(<dir>)

輸出結果

執行 store-list-crawler.R ,會將結果輸出為兩個CSV檔案:

我的開發環境:

  • Ubuntu 16.04.3 LTS
  • R version 3.4.2 (2017-09-28) -- "Short Summer"
  • RStudio Version 1.1.383 – © 2009-2017 RStudio, Inc.

尚未在其他環境測試,不確定是否能支援。

About

crawler for COSMED store information via rvest

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages