捕获和转换Web的工具

使用ASP.NET拍摄移动网站的屏幕截图

ASP.NET API

GrabzIt ASP.NET API 提供了对网站的移动版本进行屏幕截图的功能,但是,并非所有网站都具有特殊的移动版本,因此可能无法在所有情况下都起作用。 图像和PDF屏幕截图以及提取表格时都可以请求移动屏幕截图。

为此,您需要使用 BrowserType 枚举值 MobileBrowser 当创建一个 图片, PDF or , 如下所示。 然后,这将请求目标网站的移动版本。

为了获得更真实的手机屏幕截图,最好将标准的移动浏览器宽度传递给 BrowserWidth 的财产 ImageOptions 类。 或者,如果要创建PDF,请选择较小的页面尺寸。

ImageOptions options = new ImageOptions();
options.Format = ImageFormat.png;
options.BrowserWidth = 320;
options.Width = 256;
options.Height = 256;
options.RequestAs = BrowserType.MobileBrowser;

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
grabzIt.URLToImage("https://www.tesla.com", options);
grabzIt.Save("http://www.mysite.com/Home/Handler");