mercredi 30 novembre 2016

Using Python to request draftkings.com info that requires login?

I'm trying to get contest data from the url: "http://ift.tt/2gIowpP"

If you go to this URL and aren't logged in, it'll just re-direct you to the lobby. If you're logged in, it'll actually show you the contest results.

Here's some things I tried:

-First, I used Chrome's Dev networking tools to watch requests while I manually logged in

-I then tried copying the cookie that I thought contained the authentication info, it was of the form:

 'ajs_anonymous_id=%123123123123123, mlc=true; optimizelyEndUserId'

-I then stored that cookie as an Evironment variable and ran this code:

HEADERS= {'cookie': os.environ['MY_COOKIE'] }
requests.get(draft_kings_url, headers= HEADERS)

No luck, this just gave me the lobby.

I then tried request's built in:

  • HTTPBasicAuth
  • HTTPDigestAuth

No luck here either.

I'm no python expert by far, and I've pretty much exhausted what I know and the search results I've found. Any ideas?




Aucun commentaire:

Enregistrer un commentaire