Skip to content

Instantly share code, notes, and snippets.

@twillis
Created May 29, 2013 09:51
Show Gist options
  • Save twillis/5669205 to your computer and use it in GitHub Desktop.
Save twillis/5669205 to your computer and use it in GitHub Desktop.
In [1]: import logging
In [2]: from webobtoolkit import client
In [3]: logging.basicConfig(level=logging.INFO)
In [4]: URL = "http://safeway.inserts2online.com/I2O_MainFrame.jsp"; qs="pageNumber=1&drpStoreID=1954&adId=49062&adPath=SafewaySafeway05292013NorcalWeeklyAd"
In [5]: c = client.Client(client.client_pipeline(logging=True, log_level="INFO"))
In [6]: res = c.get(URL, query_string=qs)
INFO:http_log:
**************************************** - REQUEST - ****************************************
GET /I2O_MainFrame.jsp HTTP/1.0
Host: safeway.inserts2online.com:80
Accept-Encoding: gzip
INFO:http_log:
**************************************** - RESPONSE - ****************************************
302 Moved Temporarily
Date: Wed, 29 May 2013 09:48:50 GMT
Server: Apache/2.2.11 (Win32) mod_jk/1.2.27
Set-Cookie: JSESSIONID=4280276FCCCD664F462E13DDD71364A8; Path=/
Location: http://safeway.inserts2online.com/redirecting.jsp?drpStoreID=1954
Content-Length: 0
P3P: CP="CAO PSA DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"
Content-Type: text/html;charset=ISO-8859-1
Set-Cookie: BIGipServerI2O_pool_B=1865889034.20480.0000; path=/
In [7]: res2 = c.get(res.location)
INFO:http_log:
**************************************** - REQUEST - ****************************************
GET /redirecting.jsp HTTP/1.0
Cookie: BIGipServerI2O_pool_B=1865889034.20480.0000; JSESSIONID=4280276FCCCD664F462E13DDD71364A8
Host: safeway.inserts2online.com:80
Accept-Encoding: gzip
INFO:http_log:
**************************************** - RESPONSE - ****************************************
200 OK
Date: Wed, 29 May 2013 09:49:20 GMT
Server: Apache/2.2.11 (Win32) mod_jk/1.2.27
Content-Length: 1252
P3P: CP="CAO PSA DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"
Content-Type: text/html;charset=ISO-8859-1
<html>
<head>
<!--Copyright (c) 2001-2005 Vertis, Inc. All Rights Reserved.-->
<META http-equiv="Expires" content="Fri, 12 Jun 1981 08:20:00 GMT">
<META http-equiv="Pragma" content="no-cache">
<META http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Timed Out</title>
<link rel="stylesheet" type="text/css" href="I2O.css">
<script language="javascript">
function redirect()
{
try {
//alert(window.name);
if ( window.name == "shoppinglist" || window.name == "addNote" || window.name == "breakoutWin") // see shoppingList.jsp for popup window names
window.opener.top.location = "http://www.safeway.com/IFL/Grocery/Weekly-Specials";
else if (window.name == "printItem") // see breakout.jsp for window name
window.opener.opener.top.location = "http://www.safeway.com/IFL/Grocery/Weekly-Specials";
else
window.top.location = "http://www.safeway.com/IFL/Grocery/Weekly-Specials";
} catch(e) {
document.location = "http://www.safeway.com/IFL/Grocery/Weekly-Specials";
}
}
</script>
</head>
<body onload="redirect()">
<span class="stdtext">
Returning to store ads.
</span>
</body>
</html>
In [8]:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment