The easiest way to do this is through this VSCode extension: https://marketplace.visualstudio.com/items?itemName=noknownerrors.copy-visible-text (copy-visible-text). It does exactly what it says. Just install it, then select what you need and press Ctrl+Shift+C – and voilà!