Python论坛  - 讨论区

标题:[python-chinese] 如何将url补充完整!

2006年06月15日 星期四 00:13

l zh lzhlds at gmail.com
Thu Jun 15 00:13:32 HKT 2006

该死的GWF,又只能用洋葱才能进来Gmail了,
用SGMLParser分析出来的,url大都是相对地址,自己写了个补全,不是很理想咯,谁有代码借我研究一个咯
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060615/ead42574/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年06月15日 星期四 01:12

imcs ee imcsee at gmail.com
Thu Jun 15 01:12:29 HKT 2006

相对地址加上员页面地址就是绝对地址了吧
试试urlparse.urljoin
In [1]: from urlparse import urljoin

In [2]: urljoin('http://some.base.url/test.html','spam/egg/g.html')
Out[2]: 'http://some.base.url/spam/egg/g.html'

In [3]:



On 6/15/06, l zh <lzhlds at gmail.com> wrote:
> 该死的GWF,又只能用洋葱才能进来Gmail了,
> 用SGMLParser分析出来的,url大都是相对地址,自己写了个补全,不是很理想咯,谁有代码借我研究一个咯
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to
> python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to
> python-chinese-request at lists.python.cn
> Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
>
>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年06月15日 星期四 09:39

l zh lzhlds at gmail.com
Thu Jun 15 09:39:34 HKT 2006

原来还有这种方法,urlparse.urljoin,我去看看帮助
在06-6-15,imcs ee <imcsee at gmail.com> 写道:
>
> 相对地址加上员页面地址就是绝对地址了吧
> 试试urlparse.urljoin
> In [1]: from urlparse import urljoin
>
> In [2]: urljoin('http://some.base.url/test.html','spam/egg/g.html')
> Out[2]: 'http://some.base.url/spam/egg/g.html'
>
> In [3]:
>
>
>
> On 6/15/06, l zh <lzhlds at gmail.com> wrote:
> > 该死的GWF,又只能用洋葱才能进来Gmail了,
> > 用SGMLParser分析出来的,url大都是相对地址,自己写了个补全,不是很理想咯,谁有代码借我研究一个咯
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to
> > python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request at lists.python.cn
> > Detail Info:
> > http://python.cn/mailman/listinfo/python-chinese
> >
> >
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060615/c6b9c443/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号