payload = {}
for h in hiddens:
    payload[str(h.get('name'))] = str(h.get('value'))
payload['login'] = 'testtest481@yahoo.com'
payload['passwd'] = '********'
post_url = str(login_form.get('action'))
r2 = requests.post(post_url, cookies=r.cookies, data=payload)
r3 = requests.get('http://my.yahoo.com', cookies=r2.cookies)
page = r3.text
pos = page.find('testtest481')
print(page[pos - 50:pos + 300])
how to login to Yahoo programatically from an ubuntu server