-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue in fetch function #1
Comments
Thanks! Fixed in it version 0.2.0 (also on main branch here on Github). Let me know if it works! It happened because I was half-way renaming this argument from @sabyasachiDs - let me know when you start writing some code which uses this library - I'll then make a release 1.0.0 and stop making incompatible changes (like, only yesterday main class was called "Interface" instead of "Account"). |
Hi,Thanks for the update.Now its working fine. |
I'm not really sure what you mean under "generate", so will just tell you what I know: Numbers which you see on the "Performance" tab when you open a report on gtmetrix.com website are available under "attributes" of the report. For example, "First Contentful Paint" is available under Lighthouse report comes in a JSON format and you can download it with Waterfall report is a harder beast: as I understand, nice graph that we see on the "Waterfall" report tab is rendered by a script on that page and is not available for API. The best you can do is to download the "net.har" resource and extract required data from it. It's also a JSON. Note that if you want to process any of these resources (lighthouse.json or net.har) inside your program, you need first to Alternatively, you can get "report.pdf" resource which is a ready-to-print PDF file with all data you can find on the gtmetrix.com website. |
Whenever i am calling fetch function its giving error:-
import json
import python_gtmetrix2
api_key = "e8ddc55d93eb0e8281b255ea236dcc4f" # your API key
account = python_gtmetrix2.Account(api_key) # init
test = account.start_test(url) # start test
test.fetch(wait_for_completion=True) # wait for it to finish
report = test.getreport() # get test result
print(json.dumps(report, indent=2)) # do something useful with it
Error:
TypeError: fetch() got an unexpected keyword argument 'wait_for_completion'
The text was updated successfully, but these errors were encountered: