浅谈自动采集程序及入库

采集|程序|采集

<SPAN id=ArticleContent1_ArticleContent1_lblContent><SPAN style="FONT-SIZE: 12px">最近网上流行着一些采集程序,更多人拿着这些东西在网上叫卖,很多不太懂的人看着那些程序眼羡,其实如果你懂一些ASP,了解自动采集程序的原理后,你会感觉实现自动化也是那么的简单.<BR>原理及优点:通过XML中的XMLHTTP组件调用其它网站上的网页,然后批量截取或替换原有的信息使其转化成变量后再一一储存到数据库中。其主要的优点便是无需再手工添加大量的信息了,可以指定对某一个站信息的截取进行批量录入,达到省时省力的目的。与其单纯的ASP小偷程序不同的是:它已经不再依赖其目标网站。<BR>简单事例:<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #008080"> 1</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">%<BR></SPAN><SPAN style="COLOR: #008080"> 2</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #008000">''</SPAN><SPAN style="COLOR: #008000">声明取得目标信息的函数,通过XML组件进行实现。</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080"> 3</SPAN><SPAN style="COLOR: #008000"></SPAN><SPAN style="COLOR: #0000ff">Function</SPAN><SPAN style="COLOR: #000000"> GetURL(url) <BR></SPAN><SPAN style="COLOR: #008080"> 4</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">Set</SPAN><SPAN style="COLOR: #000000"> Retrieval </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">CreateObject</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Microsoft.XMLHTTP</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">) <BR></SPAN><SPAN style="COLOR: #008080"> 5</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">With</SPAN><SPAN style="COLOR: #000000"> Retrieval <BR></SPAN><SPAN style="COLOR: #008080"> 6</SPAN><SPAN style="COLOR: #000000">.Open </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">GET</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">, url, </SPAN><SPAN style="COLOR: #0000ff">False</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 7</SPAN><SPAN style="COLOR: #000000">.Send <BR></SPAN><SPAN style="COLOR: #008080"> 8</SPAN><SPAN style="COLOR: #000000">GetURL </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> bytes2bstr(.responsebody)<BR></SPAN><SPAN style="COLOR: #008080"> 9</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #008000">''</SPAN><SPAN style="COLOR: #008000">对取得信息进行验证,如果信息长度小于100则说明截取失败</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #008000"></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">len</SPAN><SPAN style="COLOR: #000000">(.responsebody)</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">100</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">then</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000">response.write </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">获取远程文件 <a href=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">url</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> target=_blank></SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">url</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"></a> 失败。"</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #000000">response.</SPAN><SPAN style="COLOR: #0000ff">end</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">end</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">End</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">With</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">16</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">Set</SPAN><SPAN style="COLOR: #000000"> Retrieval </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">Nothing</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">End Function</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">18</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #008000">''</SPAN><SPAN style="COLOR: #008000"> 二进制转字符串,否则会出现乱码的!</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">19</SPAN><SPAN style="COLOR: #008000"></SPAN><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000"> bytes2bstr(vin) <BR></SPAN><SPAN style="COLOR: #008080">20</SPAN><SPAN style="COLOR: #000000">strreturn </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">21</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000"> i </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">to</SPAN><SPAN style="COLOR: #000000"> lenb(vin) <BR></SPAN><SPAN style="COLOR: #008080">22</SPAN><SPAN style="COLOR: #000000">thischarcode </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> ascb(midb(vin,i,</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">)) <BR></SPAN><SPAN style="COLOR: #008080">23</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> thischarcode </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">h80 </SPAN><SPAN style="COLOR: #0000ff">then</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">24</SPAN><SPAN style="COLOR: #000000">strreturn </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> strreturn </SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">chr</SPAN><SPAN style="COLOR: #000000">(thischarcode) <BR></SPAN><SPAN style="COLOR: #008080">25</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">26</SPAN><SPAN style="COLOR: #000000">nextcharcode </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> ascb(midb(vin,i</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">)) <BR></SPAN><SPAN style="COLOR: #008080">27</SPAN><SPAN style="COLOR: #000000">strreturn </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> strreturn </SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">chr</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">clng</SPAN><SPAN style="COLOR: #000000">(thischarcode) </SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">h100 </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">cint</SPAN><SPAN style="COLOR: #000000">(nextcharcode)) <BR></SPAN><SPAN style="COLOR: #008080">28</SPAN><SPAN style="COLOR: #000000">i </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> i </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">29</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">end</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">30</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">next</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">31</SPAN><SPAN style="COLOR: #000000">bytes2bstr </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> strreturn <BR></SPAN><SPAN style="COLOR: #008080">32</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">end function</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">33</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #008000">''</SPAN><SPAN style="COLOR: #008000">声明截取的格式,从Start开始截取,到Last为结束</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">34</SPAN><SPAN style="COLOR: #008000"></SPAN><SPAN style="COLOR: #0000ff">Function</SPAN><SPAN style="COLOR: #000000"> GetKey(HTML,Start,Last)<BR></SPAN><SPAN style="COLOR: #008080">35</SPAN><SPAN style="COLOR: #000000">filearray</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">split</SPAN><SPAN style="COLOR: #000000">(HTML,Start)<BR></SPAN><SPAN style="COLOR: #008080">36</SPAN><SPAN style="COLOR: #000000">filearray2</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">split</SPAN><SPAN style="COLOR: #000000">(filearray(</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">),Last)<BR></SPAN><SPAN style="COLOR: #008080">37</SPAN><SPAN style="COLOR: #000000">GetKey</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">filearray2(</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">)<BR></SPAN><SPAN style="COLOR: #008080">38</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">End Function</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">39</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">40</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">Dim</SPAN><SPAN style="COLOR: #000000"> Softid,Url,Html,Title <BR></SPAN><SPAN style="COLOR: #008080">41</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">42</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #008000">''</SPAN><SPAN style="COLOR: #008000">获取要取页面的ID</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">43</SPAN><SPAN style="COLOR: #008000"></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">44</SPAN><SPAN style="COLOR: #000000">SoftId</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">Request(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Id</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)<BR></SPAN><SPAN style="COLOR: #008080">45</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">46</SPAN><SPAN style="COLOR: #000000">  Url</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://www3.skycn.com/soft/</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">SoftId</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">.html</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">47</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">48</SPAN><SPAN style="COLOR: #000000">  Html </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> GetURL(Url) <BR></SPAN><SPAN style="COLOR: #008080">49</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">50</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #008000">''</SPAN><SPAN style="COLOR: #008000">以截取天空软件的软件名为例子</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">51</SPAN><SPAN style="COLOR: #008000"></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">52</SPAN><SPAN style="COLOR: #000000">  Title </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> GetKey(Html,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><font color=''#004FC6'' size=''3''></SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"></font></b></td></tr></SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)<BR></SPAN><SPAN style="COLOR: #008080">53</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">54</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #008000">''</SPAN><SPAN style="COLOR: #008000">打开数据库,准备入库</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">55</SPAN><SPAN style="COLOR: #008000"></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">56</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">dim</SPAN><SPAN style="COLOR: #000000"> connstr,conn,rs,sql<BR></SPAN><SPAN style="COLOR: #008080">57</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">58</SPAN><SPAN style="COLOR: #000000">connstr</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">DBQ=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">server.mappath(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">db1.mdb</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"<BR></SPAN><SPAN style="COLOR: #008080">59</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">60</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"> conn</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">server.</SPAN><SPAN style="COLOR: #0000ff">createobject</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ADODB.CONNECTION</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)<BR></SPAN><SPAN style="COLOR: #008080">61</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">62</SPAN><SPAN style="COLOR: #000000">conn.open connstr<BR></SPAN><SPAN style="COLOR: #008080">63</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">64</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"> rs</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">server.</SPAN><SPAN style="COLOR: #0000ff">createobject</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">adodb.recordset</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)<BR></SPAN><SPAN style="COLOR: #008080">65</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">66</SPAN><SPAN style="COLOR: #000000">sql</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">select [列名] from [表名] where [列名]=''</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">Title</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">''"<BR></SPAN><SPAN style="COLOR: #008080">67</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">68</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #000000">rs.open sql,conn,</SPAN><SPAN style="COLOR: #000000">3</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">3</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">69</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">70</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> rs.eof </SPAN><SPAN style="COLOR: #0000ff">and</SPAN><SPAN style="COLOR: #000000"> rs.bof </SPAN><SPAN style="COLOR: #0000ff">then</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">71</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">72</SPAN><SPAN style="COLOR: #000000">rs(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">列名</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">Title<BR></SPAN><SPAN style="COLOR: #008080">73</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">74</SPAN><SPAN style="COLOR: #000000">rs.update <BR></SPAN><SPAN style="COLOR: #008080">75</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">76</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"> rs</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">nothing</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">77</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">78</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">end</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">79</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">80</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000"> rs</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff">nothing</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">81</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">82</SPAN><SPAN style="COLOR: #000000">Response.Write</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">采集完毕!"<BR></SPAN><SPAN style="COLOR: #008080">83</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">84</SPAN><SPAN style="COLOR: #000000"></SPAN><SPAN style="COLOR: #000000">%</SPAN><SPAN style="COLOR: #000000">></SPAN></DIV></DIV></SPAN></SPAN>

时间: 2025-01-21 09:13:10

浅谈自动采集程序及入库的相关文章

浅谈自动采集程序及入库ASP的实现

采集|程序|采集     最近网上流行着一些采集程序,更多人拿着这些东西在网上叫卖,很多不太懂的人看着那些程序眼羡,其实如果你懂一些ASP,了解自动采集程序的原理后,你会感觉实现自动化也是那么的简单. 原理及优点:通过XML中的XMLHTTP组件调用其它网站上的网页,然后批量截取或替换原有的信息使其转化成变量后再一一储存到数据库中.其主要的优点便是无需再手工添加大量的信息了,可以指定对某一个站信息的截取进行批量录入,达到省时省力的目的.与其单纯的ASP小偷程序不同的是:它已经不再依赖其目标网站.

浅谈自动采集程序及入库_小偷/采集

<%'声明取得目标信息的函数,通过XML组件进行实现.Function GetURL(url) Set Retrieval = CreateObject("Microsoft.XMLHTTP") With Retrieval .Open "GET", url, False.Send GetURL = bytes2bstr(.responsebody)'对取得信息进行验证,如果信息长度小于100则说明截取失败if len(.responsebody)<10

浅谈ASP自动采集程序及入库

采集|程序 最近网上流行着一些采集程序,更多人拿着这些东西在网上叫卖,很多不太懂的人看着那些程序眼羡,其实如果你懂一些ASP,了解自动采集程序的原理后,你会感觉实现自动化也是那么的简单.原理及优点:通过XML中的XMLHTTP组件调用其它网站上的网页,然后批量截取或替换原有的信息使其转化成变量后再一一储存到数据库中.其主要的优点便是无需再手工添加大量的信息了,可以指定对某一个站信息的截取进行批量录入,达到省时省力的目的.与其单纯的ASP小偷程序不同的是:它已经不再依赖其目标网站.简单事例: 1<

浅谈ASP程序实现自动采集程序及入库

采集|程序 <%'声明取得目标信息的函数,通过XML组件进行实现.Function GetURL(url) Set Retrieval = CreateObject("Microsoft.XMLHTTP") With Retrieval .Open "GET", url, False.Send GetURL = bytes2bstr(.responsebody)'对取得信息进行验证,如果信息长度小于100则说明截取失败if len(.responsebody)

关于ASP程序实现自动采集程序及入库

<%'声明取得目标信息的函数,通过XML组件进行实现.Function GetURL(url) Set Retrieval = CreateObject("Microsoft.XMLHTTP") With Retrieval .Open "GET", url, False.Send GetURL = bytes2bstr(.responsebody)'对取得信息进行验证,如果信息长度小于100则说明截取失败if len(.responsebody)<10

自动采集程序_小偷/采集

最近在做一个音乐站,音乐文件嘛...一般是从网上收集..so..写了一段采集程序.  复制代码 代码如下: <%   On Error Resume Next   Const uploadPath = "/uploads/" '文件存放路径   Const allowFileExt = "jpg,wma,swf,gif" '允许被采集的文件类型   'Const allowFileSize = "200"   Function getFil

浅谈C++应用程序中创建持久化对象

持久化的对象,是已经存储到数据库或保存到本地硬盘中的对象,我们称之为持久化对象.下面介绍C++中的持久化对象. 持久对象(persistent objects)广泛应用于游戏.分布式数据库系统.多媒体以及图形应用程序中.目前C++并不直接支持持久性(persistence)(但有一些在C++未来版本中添加持久性和反射(reflection)的建议). 持久对象可以在创建它的程序的作用域之外保持自身状态.把对象写入一个文件并在以后重建之,或者把对象传送到一台远程机器,就是这样的例子.对持久性的支持

浅谈关于java程序员面试的一些事项

本篇博文针对的是应届毕业生以及工作两三年左右的java程序员. 为什么要跳槽? 这是一个很广义的问题,每个人心中都有一份答案. 例如: 公司的待遇不好, 薪资涨幅不符合预期要求, 厌倦了出差的荒无天日的繁重工作, 公司的妹子太少, 领导太傲娇, 同事之间关系太逼格, 某某同学跳槽到某某公司之后涨到了多少多少钱, 某某同学的朋友的同事的三姑妈家的大儿子的好基友在某某高就, 等等辞职理由. 咱们就不多说了,还是谈谈怎么应付面试吧. 以下内容是我在面试中总结的一些经验,希望这些可以给各位带来帮助和启迪

浅谈开源web程序后台的安全性

一.前言 不知怎的最近甚是思念校园生活,思念食堂的炒饭.那时会去各种安全bbs上刷刷帖子,喜欢看别人写的一些关于安全技巧或经验的总结;那时BBS上很多文章标题都是:成功渗透XXX,成功拿下XXX.这里便以一篇入侵菲律宾某大学的文章引出文章的主题,我们先简要看一下过程.大学网站使用了名为joomla的开源web程序,(1)青年使用一个joomla已经公开的漏洞进入web后台(2)青年使用joomla后台上传限制不严的缺陷上传了一个webshell(3)控制主机赠送我国国旗. 原来入侵一台主机如此容