資源簡(jiǎn)介
恩..簡(jiǎn)單的scrapy簡(jiǎn)單的多層頁面爬取程序,適用于初學(xué)者想嘗試多層頁面爬取又沒有代碼看的人,明天大概會(huì)寫一篇博客分享大概的流程吧,到時(shí)候會(huì)有部分關(guān)鍵源碼

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Data;
using?System.Data.OleDb;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
namespace?Crawler
{
????public?class?AddControl
????{
????????//public?static?string?Path?=?Environment.CurrentDirectory?+?@“\Miss.xlsx“;
????????private?string?xmlPath?=?Environment.CurrentDirectory?+?@“\Miss.xml“;
????????///?
????????///?將一個(gè)DataGridView填充數(shù)據(jù),再返回給Form1
????????///?
????????///?
????????///?
????????///?
????????public?DataGridView?AddDataView()
????????{
????????????DataGridView?dataview?=?new?DataGridView();
????????????xmlToDataGridView(xmlPath?dataview);
????????????return?dataview;
????????}
????????///?
????????///?加載xml數(shù)據(jù)以便detagridveiw使用
????????///?
????????///?xml數(shù)據(jù)的?DataTable
????????public?DataTable?AddDataView2(string?xmlPath1?string?rootNode)
????????{
????????????using?(xmlControl?xmlcon?=?new?xmlControl(xmlPath1?rootNode))
????????????{
????????????????DataTable?dt?=?xmlcon.xmlToDataTable();
????????????????return?dt;
????????????}
????????}
????????///?
????????///?讀取xml數(shù)據(jù)返回中間dt
????????///?
????????///?xml文件路徑
????????///?
????????public?DataTable?xmlToDataGridView(string?filePath?DataGridView?dgv)
????????{
????????????xmlControl?xmlcon?=?new?xmlControl(xmlPath?“task_table“);
????????????DataTable?dt?=?xmlcon.xmlToDataTable();
????????????return?dt;
????????????//xmlControl?xmlcon?=?new?xmlControl(filePath?“task_table“);
????????????//DataTable?dt?=?xmlcon.xmlToDataTable();
????????????//dgv.DataSource?=?dt.DefaultView;
????????}
????????///?
????????///?新任務(wù)信息插入xml文件
????????///?
????????///?
????????///?數(shù)據(jù)數(shù)組
????????public?void?InsertIntoxml(string?filePath?string[]?datas?string?rootNode)
????????{
????????????using?(xmlControl?xmlcon?=?new?xmlControl(filePath?rootNode))
????????????{
????????????????xmlcon.xmlAddData(datas);
????????????????xmlcon.xmlSave();
????????????}
????????}
????????///?
????????///?更新xml中任務(wù)數(shù)據(jù)
????????///?
????????///?
????????///?riptname“>任務(wù)腳本名稱
????????///?節(jié)點(diǎn)
????????///?
????????public?void?UpdataIntoxml(string?filePath?string?scriptname?string?nodename?string?data)
????????{
????????????using?(xmlControl?xmlcon?=?new?xmlControl(filePath?“task_table“))
????????????{
????????????????xmlcon.xmlUpdate(scriptname?nodename?data);
????????????????xmlcon.xmlSave();
????????????}
????????}
????????///?
????????///?刪除xml中任務(wù)信息
????????///?
????????///?
????????///?
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????623??2018-06-18?12:03??爬蟲new\爬蟲\1117\.git\config
?????文件?????????73??2018-06-18?12:03??爬蟲new\爬蟲\1117\.git\desc
?????文件?????????23??2018-06-18?12:03??爬蟲new\爬蟲\1117\.git\HEAD
?????文件????????177??2018-06-18?12:03??爬蟲new\爬蟲\1117\.git\hooks\README.sample
?????文件???????9624??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\index
?????文件????????113??2018-06-18?12:03??爬蟲new\爬蟲\1117\.git\info\exclude
?????文件????????350??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\logs\HEAD
?????文件????????350??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\logs\refs\heads\master
?????文件????????150??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ms-persist.xm
?????文件???????4027??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件????????200??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件?????193061??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件?????????89??2018-06-18?12:03??爬蟲new\爬蟲\1117\.git\ob
?????文件????????708??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件????????743??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件?????146455??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件????????702??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件????????621??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件???????1340??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件???????3563??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件???????1665??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件????????707??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件???????1548??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件???????1863??2018-06-18?12:03??爬蟲new\爬蟲\1117\.git\ob
?????文件????????614??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件?????391678??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件????????751??2018-06-18?12:03??爬蟲new\爬蟲\1117\.git\ob
?????文件???????2100??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件?????132393??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
?????文件???????3952??2018-06-18?12:04??爬蟲new\爬蟲\1117\.git\ob
............此處省略506個(gè)文件信息
評(píng)論
共有 條評(píng)論