I'm new to python.
using Python 2.7 what I'm trying to achieve is I got list of url in script each url need to run on specific day in cronjob. i need to import datetime
and import time
get server day ("%A")
and match with url to run on that day this way will save me for each url doing same script
import urllib2,urllib
import re,os
import datetime
import time
mylist={
monday:'http://www.trt.tv/baba-candir/bolumler/80212',
thusday:'http://www.trt.tv/filinta/bolumler/20198',
wensday:'http://www.trt.tv/dirilis-ertugrul/bolumler/20196',
}
for days in mylist:
print days
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; az-AZ; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()