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 ?
如果您已经知道映像的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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.