Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Using Beautiful Soup - Data Wranging with MongoDB

Get Embed Code
4 Languages

Showing Revision 2 created 05/24/2016 by Udacity Robot.

  1. Okay, we're in the home stretch here. Let's figure out
  2. how to build the HTTP request such that we can
  3. pass all seven of these form elements. Now, the question
  4. is where do these elements come from? In most cases
  5. when you see form elements showing up that aren't obviously
  6. part of the form itself, and by that I mean
  7. aren't part of the user interface. Now what's gotta be
  8. going on here is that we have hidden form elements.
  9. So, let's figure out where they're at. So, here's the start
  10. of the form. If, we look down through, I don't obviously
  11. see any other elements. So, I bet it's in some of
  12. this stuff that's zipped up here. So, let's take a look.
  13. And, sure enough, right here we find three hidden form elements.
  14. So, now we've accounted for six of the seven elements we've
  15. got to pass along, the Carrier, the Airport, the Submit button
  16. and then these three. And we can see that right here,
  17. Viewstate okay, is one of those with a very long value. If I open this up, I see
  18. that here we have one of those other values.
  19. The other one in fact, that makes scrolling through all
  20. the form data in the network tab such a
  21. long and tedious process. Okay, so now we've identified
  22. where all seven of the form fields are. The
  23. question then becomes, how do we build our HTTP requests,
  24. such that this data is included? Because that's really
  25. what we have to do here. In addition to the
  26. Carrier, the Airport, and the Submit button, we've gotta
  27. send these along as well. So in this exercise what
  28. I'd like you to do is write some code
  29. here that uses the Beautiful Soup Module, and assigns values
  30. to Event Validation and View State such that they
  31. have the correct values. The values that this data source
  32. is expecting to see come across. In a little bit, we'll talk about why
  33. these values are necessary. For right now,
  34. let's just focus on building the request properly.