Session Ready
Exercise

Reproducibility

Now you've figured out the process for requesting and parsing the infobox for the Hadley Wickham page, it's time to turn it into a function that does the same thing for anyone.

You've already done all the hard work! In the sample script we've just copied all your code from the previous three exercises, with only one change: we've wrapped it in the function definition syntax, and chosen the name get_infobox() for this function.

It doesn't quite work yet, the argument title isn't used inside the function. In this exercise you'll fix that, then test it out with some other personalities.

Instructions
100 XP
  • Fix the function, by replacing the string "Hadley Wickham" with title, so that the title argument of the function will be used for the query.
  • Test get_infobox() with title = "Hadley Wickham".
  • Now, try getting the infobox for "Ross Ihaka".
  • Finally, try getting the infobox for "Grace Hopper".