python - Find Hard to Match only url from a text file -


my text file consist of :

http://www.makemytrip.com/ http://www.makemytrip.com/blog/dil-toh-roaming-hai?intid=blog_hpheader_logo   //how remove /dil-toh-roaming-hai?intid=blog_hpheader_logo  http://www.makemytrip.com/rewards/?intid=new_ch_mtr_na javascript:void(0)       //how remove  javascript:void(0) javascript:void(0) http://www.makemytrip.com/rewards/?intid=new_ch_mtr_dropdwn https://support.makemytrip.com/myaccount/mytripreward/dashboard https://support.makemytrip.com/myaccount/user/user https://support.makemytrip.com/myaccount/mybookings/bookingsummary/ https://support.makemytrip.com/customersupports.aspx?actiontype=printeticket 

how go checking urls , save them in file can parse them 1 @ time . tried python code matches , open 1st url only.

 import urllib   open("s.txt","r") file:  line in file:     url = urllib.urlopen(line)     read = url.read()     print read 


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -