Thẻ: How do take a screenshot of a webpage programmatically given the URL as input?

How do take a screenshot of a webpage programmatically given the URL as input?