百度地圖里面搜索到的公司商家電話導出表格?怎樣將把百度地圖里面搜索到的公司 電話 地址 等數據導出excel里?


好多人在問:如何將百度地圖里面搜索到的公司商家電話導出表格?怎樣將把百度地圖里面搜索到的公司 電話 地址 等數據導出excel里?

現在,很多人都在網絡上找商家,聯系業務。 百度地圖里有很多的商家聯系方式地址等數據,這便成為很多人的便捷方式。但是一個個地復制出來商家的電話,地址是一件很痛苦的事情, 於是想到開發一個程序,模擬人的操作,將所有的數據提取保存到EXCEL里。

交流學習QQ:3125547039

主要代碼思路:

 m_objConnection.Open();             button1.Enabled = false;

            txtInfo.Text = "";             txtInfo.BackColor = Color.White;             ///////////////////////////////////////////////////////////////////////////             m_iCount = 0;             int itemCount = comboQItems.Count;             for (int i = 0; i < itemCount; i++)             {                 string str1 = comboQ.Items[i].ToString();                 Application.DoEvents();                 //////////////////////////////////////////////////////////////////////////////////////////////////////////                 //第一次 提取信息                 string strResult = clsDownLoad.GetHtml(strHttp);                 //string strResult = textBox3.Text ;

                POIinfoList = GetFirstALLinfo(strResult);                 if (POIinfoList == null)                 {                     MessageBox.Show(strQuxian + "沒有獲取任何數值--null,可能出現異常了");                 }                 else                 {                     foreach (POIParameter POIinfo in POIinfoList)                     {                         AddtoTable(POIinfo, 0);                     }                 }                 lblStatus.Text = "第0";

                //第2次到最后一次                 for (int iPage = 1; iPage < m_iPageCount; iPage++)                 {                     strResult = clsDownLoad.GetHtml(strHttp);

                    POIinfoList2 = GetALLinfo(strResult, iPage);                     if (POIinfoList2 == null)                     {                         Thread.Sleep(200);                         iPage = iPage - 1;                         continue;                     }                     else                     {                         foreach (POIParameter POIinfo in POIinfoList2)                         {                             AddtoTable(POIinfo, iPage);                             Application.DoEvents();                         }                     }                     lblStatus.Text = "第" + iPage.ToString();                     Application.DoEvents();

                }                 ///////////////////////////////////////////////////////////////////////////////////////////////             }             txtInfo.Text = txtInfo.Text + "  總共條數:" + m_iCount.ToString();             txtInfo.BackColor = Color.Green;

            m_objConnection.Close();             Thread.Sleep(1000);

            //保存到Excel里去             if (checkSaveToExcel.Checked)             {                 string strExcelFile = "";                 if (m_strOldAccess.Length < 7)                 {                     strExcelFile = Application.StartupPath + "\\Data\\Over\\Excel\\" + comboShenfen.Text + "\\" + txtCity.Text + txtAim.Text + m_iCount.ToString() + ".xls";                  }                 else                 {//WYF: insert into Old Access.                     int iPos1 = m_strOldAccess.LastIndexOf('_'); // BaiduPOI_昌都市景點94.mdb                     int iPos2 = m_strOldAccess.LastIndexOf('.'); // .mdb                     string strCityAimOldCount = m_strOldAccess.Substring(iPos1 + 1, iPos2 - iPos1 - 1);

                    strExcelFile = Application.StartupPath + "\\Data\\Over\\Excel\\" + comboShenfen.Text + "\\" + strCityAimOldCount + "_" + m_iCount.ToString() + ".xls";  //信陽燈具187.xls                 }

                EasyExcel.Access2Excel(strAccessFile, strExcelFile);             }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM