Esempio n. 1
0
        private void GetUserInfoInPages(IListSheet listSheet)
        {
            int rowCount = listSheet.GetListDBRowCount();

            for (int i = 0; i < rowCount; i++)
            {
            }
        }
        private void GetLinkedinUrls(IListSheet listSheet)
        {
            ExcelWriter matchedUrlEW    = this.GetExcelWriter();
            ExcelWriter unmatchedNameEW = this.GetNoneMatchedExcelWriter();

            int rowCount = listSheet.GetListDBRowCount();

            for (int i = 0; i < rowCount; i++)
            {
                Dictionary <string, string> row = listSheet.GetRow(i);

                HtmlAgilityPack.HtmlDocument htmlDoc = this.RunPage.GetLocalHtmlDocument(listSheet, i);

                HtmlNodeCollection liElements = htmlDoc.DocumentNode.SelectNodes("//li[@class=\"b_algo\"]");
                if (liElements == null || liElements.Count == 0)
                {
                    Dictionary <string, string> resultRow = new Dictionary <string, string>();
                    resultRow.Add("kewords", row["kewords"]);
                    resultRow.Add("MatchType", "NoResults");

                    unmatchedNameEW.AddRow(resultRow);
                }
                else
                {
                    int sameNameCount = 0;
                    for (int j = 0; j < liElements.Count; j++)
                    {
                        HtmlNode linkNode = liElements[j].SelectSingleNode("./div[@class=\"b_title\"]/h2/a");
                        if (linkNode == null)
                        {
                            linkNode = liElements[j].SelectSingleNode("./h2/a");
                        }
                        string linkUrl = linkNode.GetAttributeValue("href", "");
                        if (linkUrl.EndsWith("/zh-cn"))
                        {
                            linkUrl = linkUrl.Substring(0, linkUrl.Length - "/zh-cn".Length);
                        }
                        string linkText = CommonUtil.HtmlDecode(linkNode.InnerText.Trim());
                        //重名的
                        //if (this.CheckInText(linkText, row["FirstName"]) && this.CheckInText(linkText, row["LastName"]))
                        {
                            sameNameCount++;

                            Dictionary <string, string> resultUrlRow = new Dictionary <string, string>();
                            string detailPageUrl = linkUrl + "?tt=" + i.ToString() + "_" + j.ToString();
                            resultUrlRow.Add("detailPageUrl", linkUrl);
                            resultUrlRow.Add("detailPageName", detailPageUrl);
                            resultUrlRow.Add("keywords", row["keywords"]);
                            resultUrlRow.Add("pageIndex", row["pageIndex"]);

                            matchedUrlEW.AddRow(resultUrlRow);
                        }
                    }

                    /*
                     * if (sameNameCount == 0)
                     * {
                     *  for (int j = 0; j < liElements.Count; j++)
                     *  {
                     *      HtmlNode linkNode = liElements[j].SelectSingleNode("./div[@class=\"b_title\"]/h2/a");
                     *      if (linkNode == null)
                     *      {
                     *          linkNode = liElements[j].SelectSingleNode("./h2/a");
                     *      }
                     *      string linkUrl = linkNode.GetAttributeValue("href", "");
                     *      if (linkUrl.EndsWith("/zh-cn"))
                     *      {
                     *          linkUrl = linkUrl.Substring(0, linkUrl.Length - "/zh-cn".Length);
                     *      }
                     *      string linkText = CommonUtil.HtmlDecode(linkNode.InnerText.Trim());
                     *      //姓相同,名的第一个字母相同
                     *      //if (this.CheckInText(linkText, row["FirstName"].Substring(0, 1)) && this.CheckInText(linkText, row["LastName"]))
                     *      {
                     *          sameNameCount++;
                     *
                     *          Dictionary<string, string> resultUrlRow = new Dictionary<string, string>();
                     *          string detailPageUrl = linkUrl + "?tt=" + i.ToString() + "_" + j.ToString();
                     *          resultUrlRow.Add("detailPageUrl", linkUrl);
                     *          resultUrlRow.Add("detailPageName", detailPageUrl);
                     *          resultUrlRow.Add("keywords", row["keywords"]);
                     *          resultUrlRow.Add("pageIndex", row["pageIndex"]);
                     *
                     *          matchedUrlEW.AddRow(resultUrlRow);
                     *      }
                     *  }
                     * }
                     */

                    Dictionary <string, string> resultRow = new Dictionary <string, string>();
                    resultRow.Add("keywords", row["keywords"]);
                    resultRow.Add("MatchType", sameNameCount == 0 ? "NoSameNameResults" : "HasResults");

                    unmatchedNameEW.AddRow(resultRow);
                }
            }
            matchedUrlEW.SaveToDisk();
            unmatchedNameEW.SaveToDisk();
        }
Esempio n. 3
0
        private void GetUserInfoInPages(IListSheet listSheet)
        {
            ExcelWriter ew     = this.GetExcelBaseWriter();
            ExcelWriter gzjlEw = this.GetExcelExpWriter();
            ExcelWriter jyjlEw = this.GetExcelEduWriter();
            ExcelWriter zgrzEw = this.GetExcelCertificationWriter();
            ExcelWriter yynlEw = this.GetExcelLanguageWriter();

            int rowCount = listSheet.GetListDBRowCount();

            for (int i = 0; i < rowCount; i++)
            {
                Dictionary <string, string> row = listSheet.GetRow(i);
                bool giveUp = "Y".Equals(row[SysConfig.GiveUpGrabFieldName]);
                if (!giveUp)
                {
                    string keywords = row["keywords"];
                    string pageUrl  = row["detailPageUrl"];

                    HtmlAgilityPack.HtmlDocument htmlDoc = this.RunPage.GetLocalHtmlDocument(listSheet, i);

                    HtmlNode xmNode = htmlDoc.DocumentNode.SelectSingleNode("//h1[contains(@class,\"pv-top-card-section__name \")]");
                    string   xm     = CommonUtil.HtmlDecode(xmNode.InnerText).Trim();

                    HtmlNode mqgzNode = htmlDoc.DocumentNode.SelectSingleNode("//h2[contains(@class,\"pv-top-card-section__headline \")]");
                    string   mqgz     = mqgzNode == null ? "" : CommonUtil.HtmlDecode(mqgzNode.InnerText).Trim();

                    HtmlNode dqNode = htmlDoc.DocumentNode.SelectSingleNode("//h3[contains(@class,\"pv-top-card-section__location \")]");
                    string   dq     = dqNode == null ? "" : CommonUtil.HtmlDecode(dqNode.InnerText).Trim();

                    HtmlNode gsNode = htmlDoc.DocumentNode.SelectSingleNode("//span[contains(@class,\"pv-top-card-v2-section__company-name \")]");
                    string   gs     = gsNode == null ? "" : CommonUtil.HtmlDecode(gsNode.FirstChild.InnerText).Trim();

                    HtmlNode xxNode = htmlDoc.DocumentNode.SelectSingleNode("//span[contains(@class,\"pv-top-card-v2-section__school-name \")]");
                    string   xx     = xxNode == null ? "" : CommonUtil.HtmlDecode(xxNode.FirstChild.InnerText).Trim();

                    JObject            infoJson  = null;
                    HtmlNodeCollection codeNodes = htmlDoc.DocumentNode.SelectNodes("//code");
                    if (codeNodes != null)
                    {
                        foreach (HtmlNode codeNode in codeNodes)
                        {
                            string text = CommonUtil.HtmlDecode(codeNode.InnerText);
                            if (text.Contains("positionGroupView"))
                            {
                                infoJson = JObject.Parse(text);
                                break;
                            }
                        }
                    }

                    StringBuilder      gzjl        = new StringBuilder();
                    HtmlNodeCollection gzjlLiNodes = htmlDoc.DocumentNode.SelectNodes("//section[@id=\"experience-section\"]/ul/div/li");
                    if (gzjlLiNodes != null)
                    {
                        foreach (HtmlNode gzjlLiNode in gzjlLiNodes)
                        {
                            string gzjlId = gzjlLiNode.GetAttributeValue("id", "");

                            HtmlNode gzjlNode = gzjlLiNode.SelectSingleNode("./a/div[contains(@class, \"pv-entity__summary-info \")]");
                            if (gzjlNode != null)
                            {
                                HtmlNode zwNode = gzjlNode.SelectSingleNode("./h3");
                                string   zw     = zwNode == null ? "" : CommonUtil.HtmlDecode(zwNode.InnerText.Trim());

                                HtmlNode rzgsNode = gzjlNode.SelectSingleNode("./h4/span[@class=\"pv-entity__secondary-title\"]");
                                string   rzgs     = rzgsNode == null ? "" : CommonUtil.HtmlDecode(rzgsNode.InnerText.Trim());

                                HtmlNode rzrqNode = gzjlNode.SelectSingleNode("./div[@class=\"display-flex\"]/h4[contains(@class, \"pv-entity__date-range\")]/span[last()]");
                                string   rzrq     = rzrqNode == null ? "" : CommonUtil.HtmlDecode(rzrqNode.InnerText.Trim());

                                HtmlNode rzscNode = gzjlNode.SelectSingleNode("./div[@class=\"display-flex\"]/h4[last()]/span[@class=\"pv-entity__bullet-item-v2\"]");
                                string   rzsc     = rzscNode == null ? "" : CommonUtil.HtmlDecode(rzscNode.InnerText.Trim());

                                HtmlNode szdqNode = gzjlNode.SelectSingleNode("./h4[contains(@class, \"pv-entity__location \")]/span[last()]");
                                string   szdq     = szdqNode == null ? "" : CommonUtil.HtmlDecode(szdqNode.InnerText.Trim());

                                string gzjlms = GetExpDescription(infoJson, gzjlId).Replace("\r\n", " ");

                                gzjl.Append(zw + ", " + rzgs + ", " + rzrq + ", " + rzsc + ", " + szdq + ", " + gzjlms + ". ");

                                /*
                                 * HtmlNodeCollection extraNodes = gzjlNode.SelectNodes("./div[contains(@class, \"pv-entity__extra-details\")]/p");
                                 * StringBuilder gzjlmsBuilder = new StringBuilder();
                                 * if (extraNodes != null)
                                 * {
                                 *  foreach (HtmlNode extraNode in extraNodes)
                                 *  {
                                 *      gzjlmsBuilder.Append(extraNode != null ? "" : CommonUtil.HtmlDecode(extraNode.InnerText.Trim()).Replace("\r\n", " "));
                                 *  }
                                 *  gzjl.Append(gzjlmsBuilder.ToString());
                                 * }
                                 */

                                gzjl.AppendLine();
                                this.AddExpRow(gzjlEw, xm, pageUrl, zw, rzgs, rzrq, rzsc, szdq, gzjlms);
                            }
                            else
                            {
                                HtmlNode gzjlMultiNode = gzjlLiNode.SelectSingleNode("./a/div[contains(@class, \"pv-entity__company-details\")]");

                                HtmlNode rzgsNode = gzjlMultiNode.SelectSingleNode("./div[contains(@class, \"pv-entity__company-summary-info\")]/h3/span[last()]");
                                string   rzgs     = rzgsNode == null ? "" : CommonUtil.HtmlDecode(rzgsNode.InnerText.Trim());

                                //HtmlNode rzscNode = gzjlMultiNode.SelectSingleNode("./div[contains(@class, \"pv-entity__company-summary-info\")]/h4/span[last()]");
                                //string rzsc = rzscNode == null ? "" : CommonUtil.HtmlDecode(rzscNode.InnerText.Trim());

                                HtmlNodeCollection roleNodes = gzjlLiNode.SelectNodes("./ul/li/div/div/div[contains(@class, \"pv-entity__role-details-container\")]");
                                if (roleNodes != null)
                                {
                                    foreach (HtmlNode roleNode in roleNodes)
                                    {
                                        HtmlNode zwNode = roleNode.SelectSingleNode("./div[contains(@class, \"pv-entity__summary-info-v2\")]/h3/span[last()]");
                                        string   zw     = zwNode == null ? "" : CommonUtil.HtmlDecode(zwNode.InnerText.Trim());

                                        HtmlNode rzrqNode = roleNode.SelectSingleNode("./div[contains(@class, \"pv-entity__summary-info-v2\")]/div[@class=\"display-flex\"]/h4[contains(@class, \"pv-entity__date-range\")]/span[last()]");
                                        string   rzrq     = rzrqNode == null ? "" : CommonUtil.HtmlDecode(rzrqNode.InnerText.Trim());

                                        HtmlNode rzscNode = roleNode.SelectSingleNode("./div[contains(@class, \"pv-entity__summary-info-v2\")]/div[@class=\"display-flex\"]/h4[last()]/span[@class=\"pv-entity__bullet-item-v2\"]");
                                        string   rzsc     = rzscNode == null ? "" : CommonUtil.HtmlDecode(rzscNode.InnerText.Trim());

                                        HtmlNode szdqNode = roleNode.SelectSingleNode("./h4[contains(@class, \"pv-entity__location \")]/span[last()]");
                                        string   szdq     = szdqNode == null ? "" : CommonUtil.HtmlDecode(szdqNode.InnerText.Trim());

                                        HtmlNodeCollection extraNodes    = roleNode.SelectNodes("./div[contains(@class, \"pv-entity__extra-details\")]/p");
                                        StringBuilder      gzjlmsBuilder = new StringBuilder();
                                        if (extraNodes != null)
                                        {
                                            foreach (HtmlNode extraNode in extraNodes)
                                            {
                                                gzjlmsBuilder.Append(CommonUtil.HtmlDecode(extraNode.InnerText.Trim()).Replace("\r\n", " "));
                                            }
                                        }

                                        gzjl.Append(zw + ", " + rzgs + ", " + rzrq + ", " + rzsc + ", " + szdq + ", " + gzjlmsBuilder.ToString() + ". ");
                                        this.AddExpRow(gzjlEw, xm, pageUrl, zw, rzgs, rzrq, rzsc, szdq, gzjlmsBuilder.ToString());
                                    }
                                }
                            }
                        }
                    }

                    StringBuilder      jyjl       = new StringBuilder();
                    HtmlNodeCollection jyjlANodes = htmlDoc.DocumentNode.SelectNodes("//section[@id=\"education-section\"]/ul/li/a");
                    HtmlNodeCollection jyjlNodes  = null;
                    if (jyjlANodes == null)
                    {
                        jyjlNodes = htmlDoc.DocumentNode.SelectNodes("//section[@id=\"education-section\"]/ul/li/div");
                    }
                    else
                    {
                        jyjlNodes = htmlDoc.DocumentNode.SelectNodes("//section[@id=\"education-section\"]/ul/li");
                    }
                    if (jyjlNodes != null)
                    {
                        foreach (HtmlNode jyjlNode in jyjlNodes)
                        {
                            HtmlNode summaryNode = jyjlNode.SelectSingleNode("./a/div[contains(@class, \"pv-entity__summary-info \")]");
                            HtmlNode xuexiaoNode;
                            try
                            {
                                xuexiaoNode = summaryNode.SelectSingleNode("./div/h3");
                            }
                            catch (Exception ex)
                            {
                                throw ex;
                            }
                            string xuexiao = xuexiaoNode == null ? "" : CommonUtil.HtmlDecode(xuexiaoNode.InnerText).Trim();

                            HtmlNode xueweiNode = summaryNode.SelectSingleNode("./div/p[contains(@class, \"pv-entity__degree-name\")]/span[contains(@class, \"pv-entity__comma-item\")]");
                            string   xuewei     = xueweiNode == null ? "" : CommonUtil.HtmlDecode(xueweiNode.InnerText).Trim();

                            HtmlNode zhuanyeNode = summaryNode.SelectSingleNode("./div/p[contains(@class, \"pv-entity__fos\")]/span[contains(@class, \"pv-entity__comma-item\")]");
                            string   zhuanye     = zhuanyeNode == null ? "" : CommonUtil.HtmlDecode(zhuanyeNode.InnerText).Trim();

                            HtmlNode chengjiNode = summaryNode.SelectSingleNode("./div/p[contains(@class, \"pv-entity__grade\")]/span[contains(@class, \"pv-entity__comma-item\")]");
                            string   chengji     = chengjiNode == null ? "" : CommonUtil.HtmlDecode(chengjiNode.InnerText).Trim();

                            HtmlNode shijianNode = summaryNode.SelectSingleNode("./p[contains(@class, \"pv-entity__dates\")]/span[last()]");
                            string   shijian     = shijianNode == null ? "" : CommonUtil.HtmlDecode(shijianNode.InnerText).Trim();

                            jyjl.Append(xuexiao + ", " + xuewei + ", " + zhuanye + ", " + chengji + ", " + shijian + ". ");

                            HtmlNodeCollection extraNodes     = jyjlNode.SelectNodes("./div[contains(@class, \"pv-entity__extra-details\")]/p");
                            StringBuilder      miaoshuBuilder = new StringBuilder();
                            if (extraNodes != null)
                            {
                                foreach (HtmlNode extraNode in extraNodes)
                                {
                                    string buchong = CommonUtil.HtmlDecode(extraNode.InnerText.Trim()).Replace("\r\n", " ");
                                    miaoshuBuilder.Append(buchong);
                                }
                                jyjl.Append(miaoshuBuilder.ToString());
                            }

                            this.AddEduRow(jyjlEw, xm, pageUrl, xx, xuewei, zhuanye, chengji, shijian, miaoshuBuilder.ToString());
                            jyjl.AppendLine();
                        }
                    }

                    StringBuilder      jn      = new StringBuilder();
                    HtmlNodeCollection jnNodes = htmlDoc.DocumentNode.SelectNodes("//section[contains(@class,\"pv-skill-categories-section\")]/ol/li");
                    if (jnNodes != null)
                    {
                        foreach (HtmlNode jnNode in jnNodes)
                        {
                            HtmlNode jnmcNode = jnNode.SelectSingleNode("./div/p/a/span");
                            if (jnmcNode != null)
                            {
                                string jnmc = CommonUtil.HtmlDecode(jnmcNode.InnerText).Trim();

                                HtmlNode jnrenkeNode = jnNode.SelectSingleNode("./div/a/span[contains(@class, \"pv-skill-category-entity__endorsement-count\")]");
                                string   jnrenke     = jnrenkeNode == null ? "" : CommonUtil.HtmlDecode(jnrenkeNode.InnerText).Trim();

                                jn.Append(jnmc + (jnrenke.Length == 0 ? "" : (", " + jnrenke)) + "; ");
                            }
                            else
                            {
                                jnmcNode = jnNode.SelectSingleNode("./div/p");

                                string jnmc = CommonUtil.HtmlDecode(jnmcNode.InnerText).Trim();
                                jn.Append(jnmc + "; ");
                            }
                        }
                    }
                    HtmlNodeCollection otherJnNodes = htmlDoc.DocumentNode.SelectNodes("//section[contains(@class,\"pv-skill-categories-section\")]/div[@id=\"skill-categories-expanded\"]/div/ol/li");
                    if (otherJnNodes != null)
                    {
                        foreach (HtmlNode jnNode in otherJnNodes)
                        {
                            HtmlNode jnmcNode = jnNode.SelectSingleNode("./div/p/a/span");
                            if (jnmcNode != null)
                            {
                                string jnmc = CommonUtil.HtmlDecode(jnmcNode.InnerText).Trim();

                                HtmlNode jnrenkeNode = jnNode.SelectSingleNode("./div/a/span[contains(@class, \"pv-skill-category-entity__endorsement-count\")]");
                                string   jnrenke     = jnrenkeNode == null ? "" : CommonUtil.HtmlDecode(jnrenkeNode.InnerText).Trim();

                                jn.Append(jnmc + (jnrenke.Length == 0 ? "" : (", " + jnrenke)) + "; ");
                            }
                            else
                            {
                                jnmcNode = jnNode.SelectSingleNode("./div/p");

                                string jnmc = CommonUtil.HtmlDecode(jnmcNode.InnerText).Trim();
                                jn.Append(jnmc + "; ");
                            }
                        }
                    }

                    string             szxm      = "";
                    string             zgrz      = "";
                    string             cbzp      = "";
                    string             yynl      = "";
                    string             ryjx      = "";
                    string             cyzz      = "";
                    string             sxkc      = "";
                    string             cscj      = "";
                    string             zlfm      = "";
                    HtmlNodeCollection grcjNodes = htmlDoc.DocumentNode.SelectNodes("//section[contains(@class, \"pv-accomplishments-section\")]/div/section/div");
                    if (grcjNodes != null)
                    {
                        foreach (HtmlNode grcjNode in grcjNodes)
                        {
                            HtmlNode grcjmcNode = grcjNode.SelectSingleNode("./h3");
                            string   grcjmc     = CommonUtil.HtmlDecode(grcjmcNode.InnerText).Trim();

                            StringBuilder      grcjnr      = new StringBuilder();
                            HtmlNodeCollection grcjnrNodes = grcjNode.SelectNodes("./div/ul/li");
                            if (grcjnrNodes != null)
                            {
                                if (grcjnrNodes.Count == 1)
                                {
                                    string value = CommonUtil.HtmlDecode(grcjnrNodes[0].InnerText).Trim();
                                    grcjnr.Append(value);
                                    switch (grcjmc)
                                    {
                                    case "资格认证":
                                    case "Certifications":
                                    case "Certification":
                                        this.AddCertificationRow(zgrzEw, xm, pageUrl, value);
                                        break;

                                    case "语言能力":
                                    case "Language":
                                    case "Languages":
                                        this.AddLanguageRow(yynlEw, xm, pageUrl, value);
                                        break;
                                    }
                                }
                                else
                                {
                                    foreach (HtmlNode grcjnrNode in grcjnrNodes)
                                    {
                                        string value = CommonUtil.HtmlDecode(grcjnrNode.InnerText).Trim();
                                        grcjnr.Append(value + "; ");
                                        switch (grcjmc)
                                        {
                                        case "资格认证":
                                        case "Certifications":
                                        case "Certification":
                                            this.AddCertificationRow(zgrzEw, xm, pageUrl, value);
                                            break;

                                        case "语言能力":
                                        case "Language":
                                        case "Languages":
                                            this.AddLanguageRow(yynlEw, xm, pageUrl, value);
                                            break;
                                        }
                                    }
                                }
                            }
                            switch (grcjmc)
                            {
                            case "所做项目":
                            case "Project":
                            case "Projects":
                                szxm = grcjnr.ToString();
                                break;

                            case "资格认证":
                            case "Certifications":
                            case "Certification":
                                zgrz = grcjnr.ToString();
                                break;

                            case "出版作品":
                            case "Publications":
                            case "Publication":
                                cbzp = grcjnr.ToString();
                                break;

                            case "语言能力":
                            case "Language":
                            case "Languages":
                                yynl = grcjnr.ToString();
                                break;

                            case "荣誉奖项":
                            case "Honors & Awards":
                            case "Honor & Award":
                                ryjx = grcjnr.ToString();
                                break;

                            case "参与组织":
                            case "Organization":
                            case "Organizations":
                                cyzz = grcjnr.ToString();
                                break;

                            case "所学课程":
                            case "Courses":
                            case "Course":
                                sxkc = grcjnr.ToString();
                                break;

                            case "测试成绩":
                            case "Test Score":
                            case "Test Scores":
                                cscj = grcjnr.ToString();
                                break;

                            case "专利发明":
                            case "Patent":
                            case "Patents":
                                zlfm = grcjnr.ToString();
                                break;

                            default:
                                MessageBox.Show("个人成就: " + grcjmc);
                                break;
                            }
                        }
                    }

                    Dictionary <string, string> p2vs = new Dictionary <string, string>();
                    p2vs.Add("搜索关键词", keywords);
                    p2vs.Add("名字", xm);
                    p2vs.Add("目前工作", mqgz);
                    p2vs.Add("地区", dq);
                    p2vs.Add("公司", gs);
                    p2vs.Add("学校", xx);
                    p2vs.Add("url", pageUrl);
                    p2vs.Add("工作经历", gzjl.ToString());
                    p2vs.Add("教育经历", jyjl.ToString());
                    p2vs.Add("技能", jn.ToString());
                    p2vs.Add("所做项目", szxm);
                    p2vs.Add("资格认证", zgrz);
                    p2vs.Add("出版作品", cbzp);
                    p2vs.Add("语言能力", yynl);
                    p2vs.Add("荣誉奖项", ryjx);
                    p2vs.Add("参与组织", cyzz);
                    p2vs.Add("测试成绩", cscj);
                    p2vs.Add("所学课程", sxkc);
                    p2vs.Add("专利发明", zlfm);
                    ew.AddRow(p2vs);
                }
            }
            ew.SaveToDisk();
            gzjlEw.SaveToDisk();
            jyjlEw.SaveToDisk();
            zgrzEw.SaveToDisk();
            yynlEw.SaveToDisk();
        }
Esempio n. 4
0
        private void GetAllPointInfos(IListSheet listSheet)
        {
            ExcelWriter ew         = null;
            string      sourceDir  = this.RunPage.GetDetailSourceFileDir();
            int         fileIndex  = 1;
            int         pointCount = 0;
            int         rowCount   = listSheet.GetListDBRowCount();

            for (int i = 0; i < rowCount; i++)
            {
                if (ew == null)
                {
                    ew         = this.GetWirter(fileIndex);
                    pointCount = 0;
                    fileIndex++;
                }
                else if (pointCount >= 500000)
                {
                    ew.SaveToDisk();
                    ew         = this.GetWirter(fileIndex);
                    pointCount = 0;
                    fileIndex++;
                }

                Dictionary <string, string> listRow = listSheet.GetRow(i);
                bool giveUp = "Y".Equals(listRow[SysConfig.GiveUpGrabFieldName]);
                if (!giveUp)
                {
                    string detailPageUrl = listRow[SysConfig.DetailPageUrlFieldName];
                    string filePath      = this.RunPage.GetFilePath(detailPageUrl, sourceDir);
                    string province      = listRow["province"];
                    string city          = listRow["city"];
                    string address       = listRow["formattedAddress"];
                    double lat           = double.Parse(listRow["lng"]);
                    double lng           = double.Parse(listRow["lat"]);

                    string  jsonText = FileHelper.GetTextFromFile(filePath);
                    JArray  rootJA   = JArray.Parse(jsonText);
                    JObject pointJo  = null;
                    for (int j = 0; j < rootJA.Count; j++)
                    {
                        JObject jo           = rootJA[j] as JObject;
                        string  elemeAddress = jo.GetValue("address").ToString();
                        string  elemeCity    = jo.GetValue("city").ToString();
                        double  elemeLat     = double.Parse(jo.GetValue("latitude").ToString());
                        double  elemeLng     = double.Parse(jo.GetValue("longitude").ToString());
                        if (elemeAddress.Substring(elemeAddress.Length - 3) == address.Substring(address.Length - 3))
                        {
                            pointJo = jo;
                            break;
                        }
                    }
                    if (pointJo == null)
                    {
                        for (int j = 0; j < rootJA.Count; j++)
                        {
                            JObject jo           = rootJA[j] as JObject;
                            string  elemeAddress = jo.GetValue("address").ToString();
                            string  elemeCity    = jo.GetValue("city").ToString();
                            double  elemeLat     = double.Parse(jo.GetValue("latitude").ToString());
                            double  elemeLng     = double.Parse(jo.GetValue("longitude").ToString());
                            if (Math.Abs(elemeLat - lat) < 0.05 && Math.Abs(elemeLng - lng) < 0.05)
                            {
                                pointJo = jo;
                                break;
                            }
                        }
                    }

                    if (pointJo != null)
                    {
                        string elemeAddress  = pointJo.GetValue("address").ToString();
                        string elemeCity     = pointJo.GetValue("city").ToString();
                        double elemeLat      = double.Parse(pointJo.GetValue("latitude").ToString());
                        double elemeLng      = double.Parse(pointJo.GetValue("longitude").ToString());
                        string geohash       = pointJo.GetValue("geohash").ToString();
                        string short_address = pointJo.GetValue("short_address").ToString();

                        Dictionary <string, string> elemePoint = new Dictionary <string, string>();
                        elemePoint.Add("detailPageUrl", lat + "_" + lng);
                        elemePoint.Add("detailPageName", lat + "_" + lng);
                        elemePoint.Add("province", province);
                        elemePoint.Add("city", city);
                        elemePoint.Add("elemeCity", elemeCity);
                        elemePoint.Add("address", address);
                        elemePoint.Add("lat", elemeLat.ToString());
                        elemePoint.Add("lng", elemeLng.ToString());
                        elemePoint.Add("urlFormat", "https://h5.ele.me/restapi/shopping/v3/restaurants?latitude=##lat##&longitude=##lng##&keyword=&offset=##offset##&limit=8&extras[]=activities&extras[]=tags&terminal=h5&rank_id=7ab4ea35dfbd4806b6ed02cbe08ce02a&order_by=5&brand_ids[]=&restaurant_category_ids[]=209&restaurant_category_ids[]=212&restaurant_category_ids[]=213&restaurant_category_ids[]=214&restaurant_category_ids[]=215&restaurant_category_ids[]=216&restaurant_category_ids[]=217&restaurant_category_ids[]=219&restaurant_category_ids[]=265&restaurant_category_ids[]=266&restaurant_category_ids[]=267&restaurant_category_ids[]=268&restaurant_category_ids[]=269&restaurant_category_ids[]=221&restaurant_category_ids[]=222&restaurant_category_ids[]=223&restaurant_category_ids[]=224&restaurant_category_ids[]=225&restaurant_category_ids[]=226&restaurant_category_ids[]=227&restaurant_category_ids[]=228&restaurant_category_ids[]=231&restaurant_category_ids[]=232&restaurant_category_ids[]=263&restaurant_category_ids[]=218&restaurant_category_ids[]=234&restaurant_category_ids[]=235&restaurant_category_ids[]=236&restaurant_category_ids[]=237&restaurant_category_ids[]=238&restaurant_category_ids[]=211&restaurant_category_ids[]=229&restaurant_category_ids[]=230&restaurant_category_ids[]=264");
                        ew.AddRow(elemePoint);
                    }
                }
            }
            ew.SaveToDisk();
        }