![]() I just finished writing some Python + Selenium that is far more "monstrous" but gets the job done (for today's UI/Jan.2023 at least). There is (it does not use a native API but instead scrapes the webpage and is setup via lambda and nodejs) and also Puppeteer among other dependencies. Specific to invoices, it is unfortunate but still to this day there is no native way to download them other than manually downloading them or being a lucky one to get and have to deal with all of them via email For example information on this functionality for python sdk can be found here. Refer to the documentation of the sdk you want to use. The easiest way to do it is to use aws sdk. You can also get the same kind of data programmatically. metrics "BlendedCost" "UnblendedCost" "UsageQuantity" \ By fiddling with parameters you can get the output that matches the one that is produced by billing invoice.Įxample usage of this command: aws ce get-cost-and-usage \ AWS cliĪws cli provides get-cost-and-usage command. And then convert the json into pdf (not covered in this answer). You can use aws cli or aws sdk to get the data in json format. NB: I know AWS can send the invoice PDF via e-mail but I rather fetch it directly from AWS instead of fetching from an IMAP/POP e-mail server. I cannot find documentation on the AWS API to fetch such invoice document (there is some for billing reports and other stuff, but none for the "official" document) so I start to ask myself if it is even available?īefore going scraping the AWS Console (via Scrapy, Selenium, Puppeteer) I ask the community. Then a final request to the URL that actually serves the PDF file: The moment I click to download the invoice, I can see HTTP requests to the following URL: How can I programmatically download the PDF monthly invoice the accounting department ask me every month?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |