Skip to content

Instantly share code, notes, and snippets.

@rvth
Created May 31, 2020 11:57
Show Gist options
  • Save rvth/a9f29ea34efde754cb729b41503a7fa8 to your computer and use it in GitHub Desktop.
Save rvth/a9f29ea34efde754cb729b41503a7fa8 to your computer and use it in GitHub Desktop.
# Define URL
url = 'https://www.example.co.uk'
# API request url
result = urllib.request.urlopen('https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url={}/&strategy=mobile'\
.format(url)).read().decode('UTF-8')
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment