To obtain visualization results using Python Requests #30764
Unanswered
Joker723
asked this question in
Q&A / Help
Replies: 1 comment
-
Hey @Joker723, I'm here to help you with any bugs, questions, or contributions you have. Let me know how I can assist you! You can use the from superset.utils.webdriver import WebDriverSelenium
from flask_appbuilder.security.sqla.models import User
# Replace with your actual user retrieval and dashboard URL
user = User(username='your_username')
dashboard_url = 'http://your-superset-instance/superset/dashboard/your-dashboard-id/'
# Create a WebDriverSelenium instance
webdriver = WebDriverSelenium(driver_type='chrome') # or 'firefox'
# Take a screenshot of the dashboard
screenshot = webdriver.get_screenshot(url=dashboard_url, element_name='dashboard', user=user)
# Save the screenshot to a file
if screenshot:
with open('dashboard_screenshot.png', 'wb') as f:
f.write(screenshot) Make sure to replace |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have created a related dashboard in my superset, and now I want to use Python to obtain the visualization results of this dashboard, such as images of the visualization results, but it seems that there is no related API.Can I do this?
Beta Was this translation helpful? Give feedback.
All reactions