1
Answer

Get host name from the URL

Prasant Jinaga

Prasant Jinaga

11y
1.6k
1
Hi I have some urls as below

http://g-ecx.images-amazon.com http://z-ecx.images-amazon.com http://ecx.images-amazon.com http://completion.amazon.com http://client-log.amazon.com http://www.amazon.com/184-8984226-0489751 http://www.amazon.com/access http://www.amazon.com/gp/product/B0083PWAPW/ref=kin_dev_gw_dual_t/184-8984226-04... http://www.amazon.com/gp/product/B007OZNZG0/ref=kin_dev_gw_dual_c/184-8984226-04... http://www.amazon.com/gp/prime/signup/videos/ref=nav_menu_video_redirect_combine... http://www.amazon.com/gp/prime/signup/videos/ref=nav_menu_video_pic_redirect_com... http://www.amazon.com/gp/prime/signup/videos/ref=nav_menu_shipping_redirect_comb... http://www.amazon.com/gp/prime/signup/videos/ref=nav_menu_shipping_pic_redirect_...

Now i want to retrieve only Domain name i.e amazon out of these urls.Can any one did this before??
 
Thanks,
Prasant
Answers (1)