private Boolean Index(GeckoDocument document, Uri uri)
        {
            SetCommonData(0, "TRUE");
            var data26 = document.GetElementById <GeckoElement>("prdQnaAnswerCnt").FirstChild.NodeValue;

            SetCommonData(26, data26);
            var data25 = document.GetElementById <GeckoElement>("emergencyCnt").FirstChild.NodeValue;

            SetCommonData(25, data25);
            base.Navigate("http://soffice.11st.co.kr/marketing/SellerMenuAction.tmall?method=getSellerMainNew&usedClfCd=00&memSuplCmpClfCd=01");
            return(true);
        }
 private Boolean Login(GeckoDocument document, Uri uri)
 {
     if (uri.ToString().IndexOf("returnURL") != -1)
     {
         SetCommonData(0, "FALSE");
         return(false);
     }
     document.GetElementById <GeckoInputElement>("loginName").Value = Parameter.Id;
     document.GetElementById <GeckoInputElement>("passWord").Value  = Parameter.Pw;
     document.GetElementByClassName <GeckoInputElement>("btn_login").Click();
     return(true);
 }
Exemplo n.º 3
0
 private Boolean Login(GeckoDocument document, Uri uri)
 {
     if (uri.ToString().IndexOf("ReturnValue") != -1)
     {
         SetCommonData(0, "FALSE");
         return(false);
     }
     document.GetElementByName <GeckoInputElement>("rdoSiteSelect", 0).Checked = true;
     document.GetElementById <GeckoInputElement>("SiteId").Value       = Parameter.Id;
     document.GetElementById <GeckoInputElement>("SitePassword").Value = Parameter.Pw;
     document.GetElementById <GeckoAnchorElement>("btnSiteLogOn").Click();
     return(true);
 }
Exemplo n.º 4
0
        /*
         * public static void SelectElementById<T>(this GeckoDocument document, String id, String value) where T : GeckoSelectElement
         * {
         *  var options = document.GetElementById<T>(id).Options;
         *  for (int i = 0; i < options.Length; i++)
         *  {
         *      var option = options.item((uint)i);
         *      if (String.Equals(option.Value, value))
         *      {
         *          document.GetElementById<GeckoSelectElement>("Account").SelectedIndex = i;
         *          return;
         *      }
         *  }
         * }*/
        public static ScrapTable SelectTableById(this GeckoDocument document, String id)
        {
            ScrapTable   ret        = new ScrapTable();
            GeckoElement element    = document.GetElementById(id);
            var          collection = element.GetElementsByTagName("TR");

            foreach (var row in collection)
            {
                foreach (var col in row.ChildNodes)
                {
                    if (!(col is GeckoHtmlElement))
                    {
                        continue;
                    }
                    var buffer = col as GeckoHtmlElement;
                    if ("TD".Equals(buffer.TagName) || "TH".Equals(buffer.TagName))
                    {
                        //ret.Set(col.TextContent);
                        ret.Set(col as GeckoHtmlElement);
                    }
                }
                ret.Next();
            }
            return(ret);
        }
Exemplo n.º 5
0
        public double GetCurrMoney(GeckoDocument doc)
        {
            string outval = "";
            bool   succ   = WebRule.existElement(doc, GobalSetting.AmountId, out outval);

            if (succ)
            {
                double outRes = 0.00;
                if (double.TryParse(outval, out outRes))
                {
                    return(outRes);
                }
                return(0);
            }
            return(0);

            GeckoElement ElPoint = doc?.GetElementById(GobalSetting.AmountId);
            double       ret     = 0;

            if (ElPoint != null)
            {
                double.TryParse(ElPoint?.TextContent, out ret);
            }
            return(ret);
        }
 private Boolean Login(GeckoDocument document, Uri uri)
 {
     if (uri.ToString().IndexOf("ReturnValue") != -1)
     {
         //login 실패
         //String label = document.GetElementByClassName<GeckoHtmlElement>("login_text", 0).TextContent;
         //Console.WriteLine(label);
         return(false);
     }
     document.GetElementByName <GeckoInputElement>("rdoSiteSelect", 1).Checked = true;
     document.GetElementById <GeckoInputElement>("SiteId").Value       = Parameter.Id;
     document.GetElementById <GeckoInputElement>("SitePassword").Value = Parameter.Pw;
     document.GetElementById <GeckoAnchorElement>("btnSiteLogOn").Click();
     SetCommonData(0, "TRUE");
     return(true);
 }
Exemplo n.º 7
0
 protected void PostAjaxJson(GeckoDocument document, string ajaxurl, IDictionary <String, Object> param)
 {
     try
     {
         this.buffer.Append("<HTML>");
         this.buffer.Append("<BODY>");
         this.buffer.Append("<FORM ACTION='").Append(ajaxurl).Append("' method='POST'>");
         foreach (String key in param.Keys)
         {
             this.buffer.Append("<INPUT type='hidden' name='")
             .Append(key)
             .Append("' id='")
             .Append(key)
             .Append("' value='")
             .Append(param[key])
             .Append("'>");
         }
         this.buffer.Append("<INPUT type='submit' id='trigger'>");
         this.buffer.Append("</FORM>");
         this.buffer.Append("</BODY>");
         this.buffer.Append("</HTML>");
         if (browser.Document != document)
         {
             logger.Debug("Browser!!!!!!!!!");
             document = browser.Document;
         }
         document.Body.InnerHtml = this.buffer.ToString();
         document.GetElementById <GeckoInputElement>("trigger").Click();
     }
     finally
     {
         this.buffer.Clear();
     }
 }
        private Boolean SellerMenuAction(GeckoDocument document, Uri uri)
        {
            var data02 = document.GetElementById <GeckoElement>("sellerGradePop").ParentElement.GetElementByTagName <GeckoElement>("A").TextContent;

            SetCommonData(2, data02);
            base.Navigate("https://soffice.11st.co.kr/register/SellerInfoEdit.tmall?method=sellerInfoEdit&orgMenuNo=5002");
            return(true);
        }
Exemplo n.º 9
0
        private Boolean CSManagement(GeckoDocument document, Uri uri)
        {
            var data = document.GetElementById <GeckoElement>("msg_auction").GetElementsByTagName("A")[0].FirstChild.NodeValue;

            SetCommonData(20, data);
            base.Navigate("http://www.esmplus.com/Home/SSO?code=TDM155&id=" + Parameter.Id);
            return(false);
        }
Exemplo n.º 10
0
        private Boolean SellerInfoEdit(GeckoDocument document, Uri uri)
        {
            FlowMap["register/SellerInfoEdit.tmall"] = SellerInfoEdit2;

            document.GetElementById <GeckoInputElement>("mem_pwd").Value = Parameter.Pw;
            document.GetElementByClassName <GeckoAnchorElement>("xladtype").Click();
            return(true);
        }
Exemplo n.º 11
0
        private Boolean CSManagement(GeckoDocument document, Uri uri)
        {
            var data = document.GetElementById <GeckoElement>("msg_gmarket").GetElementsByTagName("A")[0].FirstChild.NodeValue;

            // 1. 긴급메시지 건수
            SetCommonData(20, data);
            //보류
            //base.Navigate();
            return(true);
        }
Exemplo n.º 12
0
 private GeckoElement getGeckoElement(String cKeyID)
 {
     if (vGecko != null)
     {
         return(vGecko.GetElementById(cKeyID));
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 13
0
        void webBrowser1_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
        {
            if (e.Uri == null)
            {
                return;
            }
            if (e.Uri.ToString().IndexOf("login.html") != -1)
            {
                GeckoDocument doc = webBrowser1.Document;

                /*GeckoInputElement element = doc.GetElementsByName("nosave_Username").Single() as GeckoInputElement;
                 * element.Value = "admin";*/
                GeckoInputElement element = doc.GetElementById("id_nosave_Password") as GeckoInputElement;
                if (element != null)
                {
                    element.Value = "password";
                    element       = doc.GetElementById("id_login") as GeckoInputElement;
                    element.Click();
                }
            }
            if (e.Uri.ToString().IndexOf("index_pc.html") != -1)
            {
                webBrowser1.Navigate("http://192.168.0.7/init.html");
            }
            if (e.Uri.ToString().IndexOf("init.html") != -1)
            {
                GeckoDocument     doc     = webBrowser1.Document;
                GeckoInputElement element = doc.GetElementById("id_rebootBtn") as GeckoInputElement;
                if (element != null)
                {
                    element.Click();
                    Timer timer = new Timer();
                    timer.Interval = 1000 * 60;
                    timer.Tick    += (s, a) =>
                    {
                        this.Close();
                    };
                    timer.Enabled = true;
                }
            }
        }
Exemplo n.º 14
0
        private Boolean Profile(GeckoDocument document, Uri uri)
        {
            SetCommonData(1, document.GetElementByIdToNodeValue("lblCustName"));
            SetCommonData(3, document.GetElementByIdToNodeValue("lblPresident"));
            SetCommonData(4, document.GetElementByIdToNodeValue("lblRegiNumber"));
            String buffer = document.GetElementByIdToNodeValue("lblBizCateKind");

            if (buffer != null)
            {
                String[] temp = buffer.Split('/');
                SetCommonData(7, temp[0]);
                SetCommonData(8, temp[1]);
            }
            String tel1 = document.GetElementById <GeckoSelectElement>("ddlMobileTel").Value;
            String tel2 = document.GetElementById <GeckoInputElement>("txtMobileTel2").Value;
            String tel3 = document.GetElementById <GeckoInputElement>("txtMobileTel3").Value;

            SetCommonData(9, tel1 + "-" + tel2 + "-" + tel3);
            String fax1 = document.GetElementById <GeckoSelectElement>("ddlOfficeFax").Value;
            String fax2 = document.GetElementById <GeckoInputElement>("txtOfficeFax2").Value;
            String fax3 = document.GetElementById <GeckoInputElement>("txtOfficeFax3").Value;

            SetCommonData(11, fax1 + "-" + fax2 + "-" + fax3);
            String hp1 = document.GetElementById <GeckoSelectElement>("ddlMobileTel").Value;
            String hp2 = document.GetElementById <GeckoInputElement>("txtMobileTel2").Value;
            String hp3 = document.GetElementById <GeckoInputElement>("txtMobileTel3").Value;

            SetCommonData(10, hp1 + "-" + hp2 + "-" + hp3);
            String mail1 = document.GetElementById <GeckoInputElement>("txtEmailId").Value;
            String mail2 = document.GetElementById <GeckoInputElement>("txtEmailDomain").Value;

            SetCommonData(13, mail1 + "@" + mail2);
            SetCommonData(14, document.GetElementByIdToNodeValue("bn"));
            SetCommonData(15, document.GetElementById <GeckoInputElement>("txtName").Value);
            SetCommonData(16, document.GetElementById <GeckoInputElement>("txtAcctNumb").Value);

            base.Navigate("https://www.esmplus.com/Escrow/Delivery/BuyDecision");
            return(true);
        }
Exemplo n.º 15
0
        private Boolean SellerInfoEdit2(GeckoDocument document, Uri uri)
        {
            var table = document.SelectTableByClass("def_tableA");

            SetCommonData(1, table.Get(0, 1).TextContent);
            SetCommonData(4, table.Get(0, 3).TextContent);
            SetCommonData(3, table.Get(5, 1).TextContent);
            SetCommonData(5, table.Get(5, 3).TextContent);
            SetCommonData(8, table.Get(6, 1).TextContent);
            SetCommonData(7, table.Get(6, 3).TextContent);
            SetCommonData(6, table.Get(7, 1).TextContent);
            this.buffer.Clear();
            this.buffer.Append(document.GetElementByName <GeckoSelectElement>("rptvTlphnNO1").Value).Append("-");
            this.buffer.Append(document.GetElementByName <GeckoInputElement>("rptvTlphnNO2").Value).Append("-");
            this.buffer.Append(document.GetElementByName <GeckoInputElement>("rptvTlphnNO3").Value);
            SetCommonData(9, this.buffer.ToString());

            this.buffer.Clear();
            this.buffer.Append(document.GetElementByName <GeckoSelectElement>("hotlinePrtblTlphnNO1").Value).Append("-");
            this.buffer.Append(document.GetElementByName <GeckoInputElement>("hotlinePrtblTlphnNO2").Value).Append("-");
            this.buffer.Append(document.GetElementByName <GeckoInputElement>("hotlinePrtblTlphnNO3").Value);
            SetCommonData(10, this.buffer.ToString());

            this.buffer.Clear();
            this.buffer.Append(document.GetElementById <GeckoInputElement>("id_email").Value).Append("@");
            var value = document.GetElementById <GeckoSelectElement>("id_email_type").Value;

            foreach (var t in document.GetElementById <GeckoSelectElement>("id_email_type").GetElementsByTagName("OPTION"))
            {
                if ((t as GeckoOptionElement).Value.Equals(value))
                {
                    this.buffer.Append(t.TextContent);
                    break;
                }
            }
            SetCommonData(13, this.buffer.ToString());

            this.buffer.Clear();
            this.buffer.Append(document.GetElementByName <GeckoSelectElement>("faxNO1").Value).Append("-");
            this.buffer.Append(document.GetElementByName <GeckoInputElement>("faxNO2").Value).Append("-");
            this.buffer.Append(document.GetElementByName <GeckoInputElement>("faxNO3").Value);
            SetCommonData(11, this.buffer.ToString());
            SetCommonData(18, document.GetElementById <GeckoInputElement>("addrVisit").Value);

            var temp  = table.Get(29, 1);
            var temp1 = temp.GetElementsByTagName("INPUT");
            int pos   = 0;

            foreach (var t in temp1)
            {
                if ((t as GeckoInputElement).Checked)
                {
                    break;
                }
                pos++;
            }
            SetCommonData(27, temp.GetElementsByTagName("LABEL")[pos].TextContent);
            SetCommonData(16, table.Get(30, 1).TextContent);
            this.buffer.Clear();

            std = DateTime.Now.AddYears(-3).AddDays(DateTime.Now.Day * -1).AddDays(1);
            DateTime etd = std.AddMonths(1).AddDays(-1);

            index = 0;
            this.buffer.Append("http://soffice.11st.co.kr/stats/StatsPeriodProdSel.tmall?");
            this.buffer.Append(CreateGetParameter(new Dictionary <String, String>()
            {
                { "method", "getStatsPeriodProdSelList" },
                { "start", "0" },
                { "limit", "10" },
                { "stDate", std.ToString("yyyy/MM/dd").Replace("-", "/") },
                { "edDate", std.ToString("yyyy/MM/dd").Replace("-", "/") },
                { "stDatePre", std.ToString("yyyy/MM/dd").Replace("-", "/") },
                { "edDatePre", etd.ToString("yyyy/MM/dd").Replace("-", "/") },
                { "dtPeriod", "PRE_THREE_MONTH" },
                { "dispGb", "grid" }
            }));
            //PostAjaxJson(document, this.buffer.ToString(), new Dictionary<String, Object>() { });
            base.Navigate(this.buffer.ToString());
            return(true);
        }
Exemplo n.º 16
0
        public bool IsLogined(GeckoDocument doc)
        {
            return(WebRule.existElement(doc, GobalSetting.LoginedFlag));

            return(doc?.GetElementById(GobalSetting.LoginedFlag) != null);
        }
Exemplo n.º 17
0
        private Boolean BuyDecision(GeckoDocument document, Uri uri)
        {
            logger.Info("2-1.매출내역 ( 주문관리 > 구매결정완료 )");
            if (!String.IsNullOrEmpty(idkey))
            {
                try
                {
                    DateTime enddate   = DateTime.Now;
                    DateTime startdate = enddate.AddYears(-1).AddDays(1);
                    this.buffer.Append("https://www.esmplus.com/Escrow/Delivery/BuyDecisionExcel?");
                    this.buffer.Append(CreateGetParameter(new Dictionary <String, String>()
                    {
                        { "siteGbn", "0" },
                        { "searchAccount", idkey },
                        { "searchDateType", "TRD" },
                        { "searchSDT", startdate.ToString("yyyy-MM-dd") },
                        { "searchEDT", enddate.ToString("yyyy-MM-dd") },
                        { "searchKey", "ON" },
                        { "searchKeyword", "" },
                        { "searchStatus", "5010" },
                        { "searchAllYn", "N" },
                        { "searchDistrType", "AL" },
                        { "searchGlobalShopType", "" },
                        { "searchOverseaDeliveryYn", "" }
                    }));
                    logger.Debug(this.buffer.ToString());
                    PostAjaxJson(document, this.buffer.ToString(), new Dictionary <String, Object>()
                    {
                        { "eSortType", "" },
                    });
                }
                finally
                {
                    this.buffer.Clear();
                }
                return(true);
            }
            GeckoSelectElement item = document.GetElementById <GeckoSelectElement>("searchAccount");

            for (uint i = 0; i < item.Length; i++)
            {
                GeckoOptionElement option = item.Options.item(i);
                if (String.Equals(option.Label, "A_" + Parameter.Id))
                {
                    //10757^id^_1
                    DateTime enddate   = DateTime.Now;
                    DateTime startdate = enddate.AddYears(-1).AddDays(1);
                    idkey  = option.Value;
                    idcode = idkey.Split('^')[0];
                    this.logger.Info("idkey - " + idkey);
                    this.logger.Info("idcode - " + idcode);
                    try
                    {
                        this.buffer.Append("https://www.esmplus.com/Escrow/Delivery/BuyDecision?");
                        this.buffer.Append(CreateGetParameter(new Dictionary <String, String>()
                        {
                            { "siteGbn", "0" },
                            { "status", "5010" },
                            { "type", "N" },
                            { "searchTotal", "-" },
                            { "searchAccount", idkey },
                            { "searchDateType", "TRD" },
                            { "searchSDT", startdate.ToString("yyyy-MM-dd") },
                            { "searchEDT", enddate.ToString("yyyy-MM-dd") },
                            { "searchKey", "ON" },
                            { "searchKeyword", "" },
                            { "searchStatus", "5010" },
                            { "listAllView", "false" },
                            { "searchDistrType", "AL" },
                            { "searchGlobalShopType", "" },
                            { "searchOverseaDeliveryYn", "" }
                        }));
                        base.Navigate(this.buffer.ToString());
                    }
                    finally
                    {
                        this.buffer.Clear();
                    }
                    return(true);
                }
            }
            throw new ScraperException("Failed to get id key..");
        }
Exemplo n.º 18
0
 public static T GetElementById <T>(this GeckoDocument document, String id) where T : GeckoElement
 {
     return(document.GetElementById(id) as T);
 }
Exemplo n.º 19
0
 public static String GetElementByIdToNodeValue(this GeckoDocument document, String id)
 {
     return(document.GetElementById(id).FirstChild.NodeValue);
 }