# -*- coding: cp936 -*- """ 演示了使用urlopen打开http/ftp/gopher地址 """ import sys,urllib2 # http req = urllib2.Request("http://www.baidu.com") fd = urllib2.urlopen(req) while 1: data = fd.read(1024) if not len(data): break sys.stdout.write(data) # ftp req = urllib2.Request("ftp://ftp.tw.debian.org/debian/") fd = urllib2.urlopen(req) while 1: data = fd.read(1024) ...
by jcodeer - Python文档中心 - 2007-10-31 21:35:09 阅读(1300) 回复(0)
jsp中获取前一个页面的url包括参数 假如有两个页面 index.jsp 和indexto.jsp 一 index.jsp中有如下链接 indexto 二 indexto.jsp中 String url = request.getHeader("Referer"); System.out.println(url); %> 当我们访问 ../index.jsp?id=2 时进入index页面, 点击indexto链接. 在控制台将输出../index.jsp?id=2 也就是说在indexto.jsp页面获取了,index的url包括参数. 本文来自ChinaUnix博客,如果查看原文请点:http...
[code]