Using Requests and Beautiful Soup, with the most recent Beautiful Soup 4 docs.
Install our tools (preferably in a new virtualenv):
pip install beautifulsoup4
| library(shiny) | |
| library(leaflet) | |
| library(dplyr) | |
| # read data | |
| df_map <- read.delim("Sheet_R_MAP.csv",stringsAsFactors=FALSE) | |
| # define colorBin | |
| pal <- colorBin(palette=c("green","pink","red","purple"),domain=df_map$Pl,bins=c(0,5,10,15,70),pretty=TRUE,na.color="#808080",alpha=F) |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| my_news = data.frame( | |
| title = html(news_url) %>% html_nodes(".picword") %>% html_text() , | |
| title_href = html(news_url) %>% html_nodes(".picword") %>% html_attr( "href") , | |
| stringsAsFactors=FALSE) |
| library(rvest) | |
| news_url="http://news.ltn.com.tw/list/BreakingNews" | |
| title_css = html(news_url) %>% html_nodes(".picword") %>% html_text() | |
| my_news = data.frame(title = title_css) | |
| View(my_news) |
| library(rvest) | |
| news_url="http://news.ltn.com.tw/list/BreakingNews" | |
| title_css = html(news_url) %>% html_nodes(".picword") %>% html_text() | |
| my_news = data.frame(title = title_css) | |
| View(my_news) |
Using Requests and Beautiful Soup, with the most recent Beautiful Soup 4 docs.
Install our tools (preferably in a new virtualenv):
pip install beautifulsoup4