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
Post a Comment