简体   繁体   中英

How to save webpage/image

I am using the following project due to its ability to fill forms and click buttons programmatically: http://www.codeproject.com/Articles/5452/Microsoft-Web-Browser-Automation-using-C

I can browse internet programmatically however I am unable to save web pages. For example I tried to save images on my domain. I open the image however I can't save it programmatically:

private AxSHDocVw.AxWebBrowser axWebBrowser1;
object loc = "http://www.mydomain.com/img/logo.jpg";
object null_obj_str = "";
System.Object null_obj = 0;
this.axWebBrowser1.Navigate2(ref loc , ref null_obj, ref null_obj, ref null_obj_str, ref null_obj_str);

// I want to save jpg here...
HTMLDocument myDoc = new HTMLDocumentClass();
myDoc = (HTMLDocument) axWebBrowser1.Document;
// ...but don't know how to do it

There is a screenshot ability but I don't want to use that. Any help would be appreciated.

<img src="address."/>

you can search "img" after that is "src"

you can get address of file...

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM