Reputation: 1174
I tried a python code to call wget, but it returns nothing. Is there wget enabled in Lambda?
My sample code:
def lambda_handler(event, context):
import os
f = os.popen("wget -qO- --timeout=30 --tries=1 google.com")
a = []
for line in f.readlines():
a.append(line)
return a
But it returns an empty list.
Upvotes: 0
Views: 3351
Reputation: 3047
lets try to use urllib instance of wget.
import urllib.request
local_filename, headers = urllib.request.urlretrieve('http://google.com')
f = open(local_filename)
Upvotes: 1