0

I am trying to make a command like $screenshot and the bot will then send a screenshot of something on a website. I haven't found a way to actually take screenshots so I'm hoping someone here will help me out.

Medraj
  • 173
  • 2
  • 6
  • 17
  • Here's a related article to your question (https://stackoverflow.com/questions/4912092/using-html5-canvas-javascript-to-take-in-browser-screenshots) – Ryan Wilson Jul 27 '20 at 12:51

1 Answers1

0

Can use selenium to generate a screenshot of a website.

  public static void screenshot(WebDriver driver, String imageName) throws Exception{
        new File(imageName).getParentFile().mkdirs();
        File screenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
        Files.copy(screenshot, new File(imageName));
    }

selenium for javascript: node selenium
can also use puppeteer

Iceberg
  • 2,744
  • 19
  • 19