Got a YouTube account?

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

English subtitles

← Scraping Solution - Data Wranging with MongoDB

Get Embed Code
4 Languages

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

  1. Okay, so let's do this. We've taken a look
  2. at our HTTP traffic from our client application. Let's go
  3. back to the browser and see what it's doing differently.
  4. We going to go look at the network request again and
  5. if I scroll up, there's a cookie here, there's
  6. some session data that is being maintained by the browser
  7. and passed along. That's potentially at least part of the
  8. problem, so. What we can do then is actually maintain
  9. session state in our code. So what I've done
  10. here is modified what we looked at before. And in
  11. this case, we're going to use a session object
  12. instead of just a request object to do both our
  13. get and our post. We'll be using the same
  14. session object, so any session information that we get back
  15. from this first request, will be maintained and passed
  16. along when we make this request. Alright, let's run this.
  17. Let me go back to the browser and see if we've
  18. got a correct response or a response that gives us back
  19. the data we're hoping to get. And now we could see
  20. that the data we get, is actually what we were expecting. So,
  21. note that this is actually a local file and is in
  22. fact the local file that we were writing out here. And
  23. we've got the right settings here, what we would have expected
  24. had we actually submitted this through the browser. And, we're pulling back
  25. the data that we hoped to get. Still missing the CSS files, but we don't
  26. care all we care about is this data right here. Whoo hoo! We did it!