Пример #1
0
        public bool GetHtml(out string html)
        {
            bool hasGetHtml = false;

            html = "";
            ICommandResponse res;

            if (this.SendCommandSafe <GetDocumentCommand>(out res, null))
            {
                var  resDoc = res as CommandResponse <GetDocumentCommandResponse>;
                long nodeId = resDoc.Result.Root.NodeId;
                GetOuterHTMLCommand parameter = new GetOuterHTMLCommand
                {
                    NodeId = nodeId
                };
                if (this.SendCommandSafe <GetOuterHTMLCommand>(out res, parameter))
                {
                    var resHtml = res as CommandResponse <GetOuterHTMLCommandResponse>;
                    html       = (resHtml.Result.OuterHTML ?? "");
                    hasGetHtml = true;
                }
            }
            return(hasGetHtml);
        }
Пример #2
0
        public bool GetHtml(out string html)
        {
            bool hasGetHtml = false;

            html = "";
            ICommandResponse commandResponse;

            if (this.SendCommandSafe <GetDocumentCommand>(out commandResponse, null))
            {
                CommandResponse <GetDocumentCommandResponse> commandResponse2 = commandResponse as CommandResponse <GetDocumentCommandResponse>;
                long nodeId = commandResponse2.Result.Root.NodeId;
                GetOuterHTMLCommand parameter = new GetOuterHTMLCommand
                {
                    NodeId = nodeId
                };
                if (this.SendCommandSafe <GetOuterHTMLCommand>(out commandResponse, parameter))
                {
                    CommandResponse <GetOuterHTMLCommandResponse> commandResponse3 = commandResponse as CommandResponse <GetOuterHTMLCommandResponse>;
                    html       = (commandResponse3.Result.OuterHTML ?? "");
                    hasGetHtml = true;
                }
            }
            return(hasGetHtml);
        }