Week 13: Integrating MySQL and R; XML and extracting/scraping data from the web; parsing data; XPath and XPointer



How to scrape data from the web and then parse it

We give an example of how to download Derek Jeter's baseball statistics from the internet, and how to make an early, simple parsing of the statistics out of the XML:
Derek Jeter example

How to download several files from the web

We give an example of how to download a team roster, then parse the URL's for all of the players on that team, and finally then download the data for all of the players on that team:
Downloading data for all players on a team at once.

How to parse an XML file

We give two examples of how to parse an XML file.
One example uses examplegrades.xml (originally from the omegahat website).
The other example uses foodsample.xml (originally from the alistapart website).
Two examples for parsing data from XML.

Another of how to parse an XML file

We give an example of how to parse an XML file with music information.
The example uses cd_catalog.xml (originally from the w3schools website).
An example of parsing an XML catalog with CD information.

Yet another example of how to parse an XML file

We give an example of how to parse an XML file with book information.
The example uses bookexample.xml (originally from the w3schools website).
An example of parsing an XML file with book information.

How to tally the 2012 Presidential votes in Indiana

We parse the Politico data about the Indiana votes in the 2012 Presidential election.
Parsing the Indiana votes in the 2012 Presidential election.