I am trying to convert my embed tweet html to a picture. modules :
import tweepy as tw
import imgkit
this is how i get embed tweets using tweepy:
def get_embed():
# ----------------------------------- Twitter API
consumer_key = "consumer_key"
consumer_secret = "consumer_secret"
access_token = "access_token"
access_token_secret = "access_token_secret"
# ------------------ Activating Tweepy session
auth = tw.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
tw_api = tw.API(auth)
url = "https://twitter.com/DisneyPlusNL/status/1427605982524461082?s=20"
result = tw_api.get_oembed(url, theme="dark")
return result['html']
and this is how I'm trying to convert it to a picture:
def cnv2image(html):
imgkit.from_string(html, 'imagekit.png')
cnv2image(get_embed())
but the result isn't how it should be.
expected result : https://drive.google.com/file/d/1C3Cny8hpbL4MfKH2sxynBhsDM9WsnNts/view?usp=sharing
result : https://drive.google.com/file/d/1NZZykQ1fuzvf9zRLkCVl6wTcGPCa5cgE/view?usp=sharing


tw_api.get_oembed.