getting host and path from url

Michael Spencer mahs at telcopartners.com
Fri Dec 9 20:02:51 CET 2005


Steve Young wrote:
> Hi, this is probably an easy question but is there a way to get the host and path seperatly out of an url? 
>   
>   Example:
>   
>   url = http://news.yahoo.com/fc/world/iraq
>   
>   and i want some way of getting:
>   
>   host = http://news.yahoo.com
>   and
>   path = /fc/world/iraq
>   
>   thanks.
>   
>   -Steve
>    
>   
> 
> 			
> ---------------------------------
> Yahoo! Shopping
>  Find Great Deals on Holiday Gifts at Yahoo! Shopping 
> 
check out urlparse in the stdlib

Michael




More information about the Python-list mailing list