Any experts in the house?

All my screenshots are slightly fuzzy. Why?!?!

I'm using the Chromium webdriver. Grabbing the area with `element.screenshot_as_png`

Is it because I have fractional scaling? Wayland?

I have set `chrome_options.add_argument("--ozone-platform=wayland")` but to no avail.

This'll be a two-drink minimum problem, I reckon.

1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Terence Eden

OK, if you have lots of Twitter embeds in your website, I've written an easy(ish) way to replace them with static images & alt text.

github.com/edent/Tweet2Img

Run:
`python tweet2img.py 1234`

And you'll get a ready-to-paste piece of HTML with a data-encoded image.

`<a href="https:/ /twitter.com/edent/status/123"><img src="data:image/webp;base64,Ukl..." width="550" height="439" alt="text from tweet."/></a>`

It also saves the WebP and alt text if you need them.

1
4mo
Replies