Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
MorvanZhou committed Dec 30, 2017
1 parent b5d461b commit 13d512f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions notebook/3-1-requests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<RequestsCookieJar[<Cookie loggedin=1 for pythonscraping.com/pages/cookies>, <Cookie username=Morvan for pythonscraping.com/pages/cookies>]>\n"
"{'username': 'Morvan', 'loggedin': '1'}\n"
]
},
{
Expand All @@ -132,7 +132,7 @@
"source": [
"payload = {'username': 'Morvan', 'password': 'password'}\n",
"r = requests.post('http://pythonscraping.com/pages/cookies/welcome.php', data=payload)\n",
"print(r.cookies)\n",
"print(r.cookies.get_dict())\n",
"r = requests.get('http://pythonscraping.com/pages/cookies/profile.php', cookies=r.cookies)\n",
"print(r.text)"
]
Expand Down
2 changes: 1 addition & 1 deletion source_code/3-1-requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def post_login():
# http://pythonscraping.com/pages/cookies/login.html
payload = {'username': 'Morvan', 'password': 'password'}
r = requests.post('http://pythonscraping.com/pages/cookies/welcome.php', data=payload)
print(r.cookies)
print(r.cookies.get_dict())
# http://pythonscraping.com/pages/cookies/profile.php
r = requests.get('http://pythonscraping.com/pages/cookies/profile.php', cookies=r.cookies)
print(r.text)
Expand Down

0 comments on commit 13d512f

Please sign in to comment.