Lambdaify Kohls scraping

Move to Lambda function setup and add orchestration and word lists for full runs. Credit for the word lists goes to: http://www.desiquintans.com/nounlist
This commit is contained in:
NMerz
2020-10-18 17:51:08 -04:00
parent 7dbea8f805
commit 79598bf9e9
9 changed files with 6927 additions and 55 deletions

View File

@@ -0,0 +1,19 @@
import json
import boto3
def lambda_handler(event, context):
with open("words.txt") as words_file:
words = json.load(words_file)
print(words)
for word in words:
client = boto3.client('lambda')
response = client.invoke(
FunctionName='KohlsScraper',
InvocationType="Event",
LogType="None",
Payload= """{"toScrape": \"""" + word + "\"}"
)
return {
'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}