-
-
Save danielredondo/064a25a9708333a5351a34e7c235e737 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script works for extracting data of Futbin with XBox prices | |
# It currently only supports one page of Futbin | |
library(httr) | |
library(rvest) | |
library(magrittr) | |
a <- GET("https://www.futbin.com/players?page=1&version=bronze&club=12", | |
set_cookies(platform = "xone")) %>% content() | |
data <- a %>% rvest::html_nodes(xpath = "//table") %>% | |
magrittr::extract(1) %>% rvest::html_table() %>% | |
magrittr::extract2(1) | |
colnames(data) <- c("name", "rating", "position", "version", | |
"price", "skills", "weak_foot", "work_rate", "pac", | |
"sho", "pas", "dri", "def", "phy", "hei", "popularity", | |
"base_stats", "in_game_stats") | |
print(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment