Blizzard’s Overwatch is a team based first person shooter with over 20 unique heroes available on pc, XBox, and Playstation. The goal is to use a team of 6 to move a payload to a location, capture an objective, or a hybrid of both payload and capture. Blizzard stores information about your performance such as damage done, healing done, objective time, etc. on their website. Unfortunately, at the time of writing this, there is no official API available for Overwatch, so we will need to scrape the website to get this information.
For this example, we will be using this profile, which is one of the more well known players. The data is split into two different play categories, quick play and competitive play. Each play mode has information for each played heroes in that mode. The hero data information for the play modes will be what we are after.
The URL (example: https://playoverwatch.com/en-gb/career/pc/us/iddqd-2884) can be broken down into 3 important parts, pc, us, and iddqd-2884. This is:
platform - computer (pc), XBox (xbl), or Playstation (psn).
region - North America (us), Europe (eu), Korea (kr), or China (cn)
battle tag - Unique identifier of the player.
So, if the player foobar-1234 was playing on the Korean servers on a computer the last three arguments become /pc/kr/foobar-1234.
There is a lot of information presented initially on the page. The featured stats and a drop down menu with top hero, win percent, etc. are all based off of the Career Stats tables. It is these tables in career stats that we will be scraping.
The website breaks information down into either quick or competitive play and to obtain the information for each the page source shows it is a node with either “#quick-play” or “#competitive-play”
The last part that needs to be addressed is selecting each table from the career stats node. Since each hero will have mostly the same tables such as combat, hero specific, etc. we will need to get the correct hero. This selector will look like this (“select > option”):
The value will have to be matched to the table to know what hero we are dealing with.
Scrape the Data
Taking a quick look at some tables, using knitr::kable for table formatting:
Melee Final Blows
This shows how to scrape data off of Blizzard’s Overwatch site. More work needs to be done to format values correctly and set up a proper storage of the data if doing it for more than a few IDs.