python-scraping icon indicating copy to clipboard operation
python-scraping copied to clipboard

chapter 10 - handling redirects

Open spurra opened this issue 9 years ago • 2 comments

Hi, I'm running the 3-javascriptRedirect.py file from chapter 10, and StaleElementReferenceException is not thrown, therefore the full 10 sec timeout is performed. Is this a bug?

spurra avatar Jun 07 '16 20:06 spurra

Same for me. It just time out directly no matter what. I was wondering why checking the html tag would work. Both pages should have the html tag, the checking result will always be positive. The output:

Timing out after 10 seconds and returning
<html><head>
<title>The Destination Page!</title>

</head>
<body>
This is the page you are looking for!

</body></html>

lxian avatar Aug 24 '16 03:08 lxian

import requests

params = {'username': 'Ryan', 'password': 'password'} r = requests.post('http://pythonscraping.com/pages/cookies/welcome.php', params) print('Cookie is set to:') print(r.cookies.get_dict()) print('Going to profile page...') r = requests.get('http://pythonscraping.com/pages/cookies/profile.php', cookies=r.cookies) print(r.text)

the python coding does not work. I try for many time but the result is not right.

allwell997 avatar Nov 13 '18 00:11 allwell997