We live in an annoying age of mass AI scraper bots that don't obey the law.
In many scenarios(but not all) you can protect content by drawing the text in html5
To draw text on an HTML5 canvas using JavaScript, you use the fillText() or strokeText() methods of the 2D rendering context.
- First, obtain a reference to the canvas element and its 2D context using
getContext('2d'). - Then, set properties like
font,fillStyle,strokeStyle,textAlign, andtextBaselineto control the appearance and positioning of the text. - The
fillText()method draws filled text, where the text is filled with the currentfillStyle - Its syntax is
ctx.fillText(text, x, y [, maxWidth]), wheretextis the string to draw,xandyare the coordinates for the starting point, andmaxWidthis an optional parameter to constrain the text width.
Here is a good standard hello world
const canvas = document.getElementById('canvas');const ctx = canvas.getContext('2d');ctx.fillStyle = 'green';ctx.font = '60px san-serif';ctx.fillText('Hello, World!', 100, 200);