Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get amazon remaining grant credits... scraping an AWS site
Fetches the remaining EDU grant credits in an Amazon account using scraping
with Python's RoboBrowser (perl's WWW::Mechanize look-alike)
from robobrowser import RoboBrowser
credits_url = ''
browser = RoboBrowser(history=True)
form = browser.get_form()
# Sorry, no proper credentials security until Amazon exposes this attribute
# as a proper API call (perhaps via CloudWatch Billing?)
form['email'].value = '<AWS_USERNAME>'
form['password'].value = '<AWS_PASSWORD>'
for field in browser.response.text.split('\n'):
if 'Credits Balance' in field:
print field.split('$')[-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment