Flurry Login Requests.Session() Python 3
<p>So I had this question answered before <a href="http://stackoverflow.com/questions/38670599/flurry-scraping-using-python3-requests-session">here</a>. However, something on the Flurry website has changed and the answer no longer works.</p>

<pre><code>from bs4 import BeautifulSoup
import requests 

loginurl = "https://dev.flurry.com/secure/loginAction.do"
csvurl = "https://dev.flurry.com/eventdata/.../..."       #URL to get CSV
data = {'loginEmail': 'user', 'loginPassword': 'pass'}

with requests.Session() as session:
    session.headers.update({
         "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36"})
    soup = BeautifulSoup(session.get(loginurl).content)
    name = soup.select_one("input[name=struts.token.name]")["value"]
    data["struts.token.name"] = name
    data[name] = soup.select_one("input[name={}]".format(name))["value"]
    login = session.post(loginurl, data=data)
    getcsv = session.get(csvurl)
</code></pre>

<p>The code above worked great for the last month and then it stopped working last week. For the life of me, I can't figure out what on the website has changed. ID Names and tokens all look correct, username and pass hasnt changed. Im at a loss.</p>

<p>If I login manually, I can download the csv just fine using the <code>csvurl</code>.</p>

<p><code>login.histroy</code> shows:</p>

<pre><code>[&lt;Response [302]&gt;, &lt;Response [302]&gt;, &lt;Response [302]&gt;, &lt;Response [302]&gt;, &lt;Response [303]&gt;]
</code></pre>

<p>If anyone could take a look and figure out where I am going wrong, I would greatly appreciate it.</p>

<p>Thanks.</p>

<p><strong>UPDATE</strong></p>

<p>So from the new login address, I see the post needs to be in this format:</p>

<pre><code>{"data":{"type":"session","id":"bd7d8dc1-4a86-4aed-a618-0b2765b03fb7","attributes":{"scopes":"","email":"myemail","password":"mypass","remember":"false"}}}
</code></pre>

<p>What I can't figure out though is how they generated the id. Can anyone take a look? </p>

<p>They now have a new design and a <a href="https://login.flurry.com/home" rel="nofollow">new login page</a> to which they redirect you too - that's why you see 302 and 303 status codes. The login process and logic behind it, the URLs, links to CSV files - everything is now different and you have to "reimplement"/"remimic" it. </p>

python python-3.x session beautifulsoup flurry