【发布时间】:2019-08-22 07:32:59
【问题描述】:
我们在 DotNetBrowser 上显示的网站包含验证码图像元素。在代码元素中捕获此元素图像类型的方法是什么?
网址:https://paydas.its.gov.tr/hesap_yonetimi/giris
browserView = new WinFormsBrowserView(BrowserFactory.Create(BrowserType.LIGHTWEIGHT));
//...
browserView.Browser.SetSize(1024, 768);
Bitmap screenshot = browserView.Browser.ImageProvider.GetImage() as Bitmap;
DOMElement captchaElement = browserView.Browser.GetDocument().GetElementById("imgCaptcha");
pictureBox1.Image = screenshot?.Clone(captchaElement.BoundingClientRect, screenshot.PixelFormat);
这种方法不健康。
【问题讨论】:
标签: c dotnetbrowser