Reputation: 61
import urllib2,urllib
data = urllib.urlencode({"username" : "usr", "password" : "pass", "lang" : "eng", "usertype" : "cashier", "submit" : "Enter"})
req = urllib2.Request("https://website/index.php", data)
opener = urllib2.build_opener()
response = opener.open(req)
the_page = response.read()
print the_page
OUTPUT:
<script type="text/javascript">window.location.href = "/h383/list.php";</script>
So I want to reach list.php any suggestions?
Upvotes: 0
Views: 1498
Reputation: 169123
First, try delivering a stern lecture to the webmaster about graceful degradation and web standards.
If that fails, then you ultimately have two options:
window
and window.location
objects, and catching the assignment to its href
property. (Pros: This will allow for JS-built URLs to work, and is fairly future-proof. Cons: This is probably over-engineering, and won't be a simple task.)Upvotes: 2