上QQ阅读APP看书,第一时间看更新
How it works
The boto3 library wraps the AWS S3 API in a Pythonic syntax. The .client() call authenticates with AWS and gives us an object to use to communicate with S3. Make sure you have your keys in environment variables, as otherwise this will not work.
The bucket name must be globally unique. At the time of writing, this bucket is available, but you will likely need to change the name. The .create_bucket() call creates the bucket and sets its ACL. put_object() uses the boto3 upload manager to upload the scraped data into the object in the bucket.