get url and writes output file