Added urllib/urllib2 instead of os.popen

Added urllib/urllib2 instead of os.popen.