[英]how to make a WatiN internal http request?
just wonder whether it's possible to make an internal extra request to an image without using separate code. 只是想知道是否可以在不使用单独代码的情况下对图像进行内部额外请求。 eg,
例如,
var browser = new IE();
string url = "https://www.google.com/"
browser.GoTo(url);
// extract http://www.google.com/images/logos/ps_logo2.png
//using a http request using browser ?
browser.Images
wont let me save the image :|, how can I make an external request to get the image ? browser.Images
不会让我保存图像:|,如何获取外部请求来获取图像?
如果您已经知道映像的URL,则可以使用System.Net
命名空间中的WebClient类。
byte[] image = new WebClient().DownloadData("https://www.google.com/images/logos/ps_logo2.png");
Maybe these steps work: 也许这些步骤有效:
var image = browser.Image(Find.First())
browser.GoTo(image.href);
var screenshot= new UtilityClasses.CaptureWebPage(_browser).CaptureWebPageImage(false, false, 100);
var width = image.Style.GetAttributeValue("width");
var height= image.Style.GetAttributeValue("height");
HTH, Jeroen HTH,Jeroen
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.