—
title: “MY472 Final Exam Part C: Scraping additional data”
—
Now you will collect additional data to continue exploring the broader research question in the exam.
1. The website [EveryPolitician](https://everypolitician.org/) contains information on legislators around the world. Using the webscraping tools you learned in the course, create a dataset with two variables — `bioguide_id` and `age` — by scraping the data available in these two pages: https://everypolitician.org/united-states-of-america/house/term-table/114.html and https://everypolitician.org/united-states-of-america/senate/term-table/114.html
If you are having trouble scraping it, you can also just click on “Download data” (but you will not get full mark if you do that!)
“`{r}
“`
2. Are there more negative comments on the pages of younger politicians? Use any statistical or graphical methods that you consider appropriate to answer this question.
“`{r}
“`
3. The file `congress-list.csv` contained five other legislator-level variables (chamber, gender, party, ideology, state). Choose TWO of these variables and explore whether they are related with the extent to which Members of Congress receive negative comments on their Facebook pages. Write a summary of your findings.
“`{r}
“`