Getting My Hands Dirty.

This week, I actually got a Python coding assignment: web scraping. Web scraping is something that I have heard so much about, and yet have never had the opportunity to learn how to do.

In theory, web scraping entails grabbing certain elements of an HTML page that contain information you want. For this assignment, we were looking for content titles, their live URLs, the tags or elements that we applied to the content, the word count, and the body text of the content. Essentially all of the important stuff.

Well, after a lot of trial and error, investigating the HTML content to find the appropriate tags to call, scanning coding forums for guidance when I got stuck (thanks, StackOverflow), and surprisingly minimal hair-pulling, I managed to put together a Python script that pulled all of these elements from the HTML page and saved them to a valid XML file. I was able to do this with one caveat: the HTML page had to be saved to my local machine first. I spent the next few days after writing the script to try and scrape the content from the live site. However, because the content was so embedded in JavaScript, as well as behind a password-protected interface, there was only so much I could do. While I managed to get past the password wall, I could not get all of the content I needed for the scrape. My boss said that was fine, that we would have no issues just saving the HTML page first, but something tells me I will want to revisit that code later on in the summer to try and figure out how to make it work.

As for our intern programming for this week, this week we were immersed in volunteering. Warner Media strongly advocates for its employees to go out into the world and do good things. For us interns, we had two different opportunities to give back: the first was a lunch hour with local high school students who were interested in joining the media industry, and the second was a meal-packing session with Open Hand Atlanta. I chose to partake in both events.

The lunch was honestly so fun. The interns partnered up and were given a group of five high schoolers to just sit and talk with over sandwiches. It was inspiring to listen to their stories and learn what they wanted to do with their lives. We also got the opportunity to discuss our current positions with them, as well as answer any questions that they had. I felt like I put on my New Student Enrollment hat for a bit, particularly when they started asking questions about college in general. What majors they should consider, why we chose our respective schools, all the details eager high schoolers want to know about college. It was wonderful.

The meal-packing event was a great bonding experience for those of us who went. Open Hand Atlanta has an extraordinary mission of serving those in the Atlanta area who are unable to get out and obtain their own groceries due to age, disability, or other factors. We spent a three hour shift packing healthy meals containing things like chicken salad, quinoa, and vegetable soup. It was a great way to get out of the office and help people within our Atlanta community.

Leave a Reply

Your email address will not be published. Required fields are marked *