Python- request.post login credentials for website
<p>So I am trying to write this python script and add it to my Windows Task Scheduler to be executed every time I log on my Work Machine. The script should open a webpage and post my login info.</p>

<pre><code>import webbrowser
import os


url = 'www.example.com'
webbrowser.open(url)
import requests
url = 'www.example.com'
values = ["'username': username","'password': 'somepass'"]

r = requests.post(url, data=values)
print r.content
</code></pre>

<p>When I run the script it opens my browser and lands on the page I want it to however Nothing is posted and I get these errors on my IDE;</p>

<pre><code>`Traceback (most recent call last):
 File "C:\Users\user\Desktop\Scripts\myscript.py", line 20, in &lt;module&gt;
r = requests.post(url, data=values)
 File "C:\Python27\lib\requests\api.py", line 110, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Python27\lib\requests\api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\requests\sessions.py", line 462, in request
prep = self.prepare_request(req)
File "C:\Python27\lib\requests\sessions.py", line 395, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "C:\Python27\lib\requests\models.py", line 302, in prepare
self.prepare_body(data, files, json)
File "C:\Python27\lib\requests\models.py", line 462, in prepare_body
body = self._encode_params(data)
File "C:\Python27\lib\requests\models.py", line 95, in _encode_params
for k, vs in to_key_val_list(data):
 ValueError: too many values to unpack*` 
</code></pre>

<p>That is what your dict should look like</p>

<pre><code>values = {'username': 'username','password': 'somepass'}
</code></pre>

python request