jsoup

jsoup

解析url

package Jsoup;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.junit.Test;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
public class JsoupTest {
    @Test
    public void testUrl() throws IOException {
        Document doc = Jsoup.parse(new URL("http://www.baidu.com"), 3000);
        Elements title1 = doc.getElementsByTag("link");
        for (Element e:title1
             ) {
            System.out.println(e);
        }
    }
}
//输出
<link rel="dns-prefetch" href="//dss1.bdstatic.com">
<link rel="dns-prefetch" href="//ss1.bdstatic.com">
<link rel="dns-prefetch" href="//sp0.baidu.com">
<link rel="dns-prefetch" href="//sp1.baidu.com">
<link rel="dns-prefetch" href="//sp2.baidu.com">

解析字符串

    @Test
    public void testString() throws Exception{
        //获取字符串.由html组成的txt文本。
        String s = FileUtils.readFileToString(new File("C:\\Users\\DELL\\Desktop\\demo.txt"), "utf-8");
        //解析字符串
        Document doc = Jsoup.parse(s);
        Elements title = doc.getElementsByTag("title");
        System.out.println(title);

    }
}
//输出
<title>百度一下,你就知道</title>

解析文件

   @Test
    public void testFile() throws Exception{
        Document document = Jsoup.parse(new File("C:\\Users\\DELL\\Desktop\\demo.txt"), "utf8");
        Elements title = document.getElementsByTag("title");
        System.out.println(title);
    }

使用DOM方式遍历文档

获取Element 最常用的四种方式

  1. 根据id getElementById

  2. 根据tag getElementsByTag

    ,,<li></code>,开头的标签类型。</p> <p>class不可以。</p> </li> <li> <p>根据 class getElementsByClass</p> <p>如class=“bar”</p> </li> <li> <p>根据attribute获取元素 getElementsByAttribute</p> <p>如class,等以及自己命名的属性</p> <p>li,h1不可以,这是tag,不是属性。</p> </li> </ol> <h3>由Element获取数据</h3> <ol> <li>获取id</li> <li>获取className</li> <li>获取attribute以及attributes</li> <li>获取text</li> </ol> <pre><code class="prism language-java"> <span class="token annotation punctuation">@Test</span> <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">testTraverse</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">throws</span> Exception <span class="token punctuation">{</span> Document document <span class="token operator">=</span> Jsoup<span class="token punctuation">.</span><span class="token function">parse</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">File</span><span class="token punctuation">(</span><span class="token string">"C:\\Users\\DELL\\Desktop\\demo.html"</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token string">"utf-8"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> Element element <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">"lili"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>element<span class="token punctuation">)</span><span class="token punctuation">;</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>element<span class="token punctuation">.</span><span class="token function">id</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>element<span class="token punctuation">.</span><span class="token function">className</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>element<span class="token punctuation">.</span><span class="token function">text</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>element<span class="token punctuation">.</span><span class="token function">attr</span><span class="token punctuation">(</span><span class="token string">"class"</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> element<span class="token punctuation">.</span><span class="token function">attributes</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span>s<span class="token operator">-</span><span class="token operator">></span><span class="token punctuation">{</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span> <span class="token comment">//</span> element <span class="token operator"><</span>li id<span class="token operator">=</span><span class="token string">"lili"</span> <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">"class_a class_b"</span><span class="token operator">></span> <span class="token operator"><</span>a href<span class="token operator">=</span><span class="token string">"http://www.baidu.com"</span> target<span class="token operator">=</span><span class="token string">"_blank"</span><span class="token operator">></span> <span class="token operator"><</span>span <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">"s_name"</span><span class="token operator">></span> 内径 <span class="token operator"><</span><span class="token operator">/</span>span<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>a<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token comment">//id(); </span> lili <span class="token comment">//className()</span> class_a class_b <span class="token comment">//text()</span> 内径 <span class="token comment">//attr(key,val) </span> class_a class_b <span class="token comment">//attributes()</span> id<span class="token operator">=</span><span class="token string">"lili"</span> <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">"class_a class_b"</span> </code></pre> <h2>selector选择器</h2> <p>如document.select(String cssQuery)</p> <p>document.select(Evaluator evaluator)</p> <p>参数:</p> <ol> <li> <p>tagname</p> <p>如span,li,h2</p> </li> <li> <p>#id</p> <p>#187</p> </li> <li> <p>.class</p> <p>.class_a</p> </li> <li> <p>[attribute]</p> <p>[abc]</p> </li> <li> <p>[attr=value]</p> </li> </ol> <pre><code class="prism language-java"> <span class="token annotation punctuation">@Test</span> <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">testTraverse</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">throws</span> Exception <span class="token punctuation">{</span> Document document <span class="token operator">=</span> Jsoup<span class="token punctuation">.</span><span class="token function">parse</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">File</span><span class="token punctuation">(</span><span class="token string">"C:\\Users\\DELL\\Desktop\\demo.html"</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token string">"utf-8"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>document<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token string">"h1"</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//tagname</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>document<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token string">"#lili"</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//#id</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>document<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token string">".class_a"</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//.class</span> System<span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span>document<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token string">"[food=187]"</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//[attr] or [attr=val]</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span> </code></pre> <h2>组合使用</h2> <ol> <li>tagname#id</li> <li>tagname.class</li> <li>tagname[attr]</li> <li>以上任意组合</li> <li>ancestor child:查询某个元素下子元素</li> <li>parent>chid:查询某个元素下直接子元素</li> <li>parent>*:查询某个元素下所有直接子元素</li> </ol> <p>获取内径,</p> <pre><code class="prism language-java">document<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token string">"li#lili span.a_name"</span><span class="token punctuation">)</span> </code></pre> <p><a href="http://img.e-com-net.com/image/info8/c1b468820d52412e85f5833b9ab660a4.jpg" target="_blank"><img src="http://img.e-com-net.com/image/info8/c1b468820d52412e85f5833b9ab660a4.jpg" alt="jsoup_第1张图片" width="562" height="282" style="border:1px solid black;"></a></p> <p>html原码:</p> <pre><code class="prism language-java"><span class="token operator"><</span><span class="token operator">!</span>DOCTYPE html PUBLIC <span class="token string">"-//W3C//DTD XHTML 1.0 Transitional//EN"</span> <span class="token string">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span class="token operator">></span> <span class="token operator"><</span>html xmlns<span class="token operator">=</span><span class="token string">"http://www.w3.org/1999/xhtml"</span> xml<span class="token operator">:</span>lang<span class="token operator">=</span><span class="token string">"zh-cn"</span><span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>head<span class="token punctuation">></span></span> <span class="token operator"><</span>meta http<span class="token operator">-</span>equiv<span class="token operator">=</span><span class="token string">"Content-Type"</span> content<span class="token operator">=</span><span class="token string">"text/html;charset=UTF-8"</span> <span class="token operator">/</span><span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>title<span class="token punctuation">></span></span>网页标题<span class="token operator"><</span><span class="token operator">/</span>title<span class="token operator">></span> <span class="token operator"><</span>meta name<span class="token operator">=</span><span class="token string">"keywords"</span> content<span class="token operator">=</span><span class="token string">"关键字列表"</span> <span class="token operator">/</span><span class="token operator">></span> <span class="token operator"><</span>meta name<span class="token operator">=</span><span class="token string">"description"</span> content<span class="token operator">=</span><span class="token string">"网页描述"</span> <span class="token operator">/</span><span class="token operator">></span> <span class="token operator"><</span>link rel<span class="token operator">=</span><span class="token string">"stylesheet"</span> type<span class="token operator">=</span><span class="token string">"text/css"</span> href<span class="token operator">=</span><span class="token string">""</span> <span class="token operator">/</span><span class="token operator">></span> <span class="token operator"><</span>style type<span class="token operator">=</span><span class="token string">"text/css"</span><span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>style<span class="token operator">></span> <span class="token operator"><</span>script type<span class="token operator">=</span><span class="token string">"text/javascript"</span><span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>script<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>head<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>body<span class="token punctuation">></span></span> <span class="token operator"><</span>h2 align<span class="token operator">=</span><span class="token string">"center"</span> <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">"class_a class_b"</span><span class="token operator">></span>PHP介绍<span class="token operator"><</span><span class="token operator">/</span>h2<span class="token operator">></span> <span class="token operator"><</span>h2 align<span class="token operator">=</span><span class="token string">"center"</span> food<span class="token operator">=</span><span class="token string">"187"</span><span class="token operator">></span>PHP介绍<span class="token number">2</span><span class="token operator"><</span><span class="token operator">/</span>h2<span class="token operator">></span> <span class="token operator"><</span>h2 align<span class="token operator">=</span><span class="token string">"center"</span> <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">"class_a "</span><span class="token operator">></span>PHP介绍<span class="token number">3</span><span class="token operator"><</span><span class="token operator">/</span>h2<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>h3<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>i<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>b<span class="token punctuation">></span></span>PHP未来和发展趋势:<span class="token operator"><</span><span class="token operator">/</span>b<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>i<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>h3<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>ol<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span>我就买了一<span class="token operator"><</span>font color<span class="token operator">=</span><span class="token string">"red"</span><span class="token operator">></span><span class="token number">5000</span>万<span class="token operator"><</span><span class="token operator">/</span>font<span class="token operator">></span>个账号,全国各省市的房建、市政、公路、园<span class="token operator"><</span>font color<span class="token operator">=</span><span class="token string">"red"</span><span class="token operator">></span><span class="token number">60</span><span class="token operator">%</span><span class="token operator"><</span><span class="token operator">/</span>font<span class="token operator">></span>林、水利、土地整理<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span>什么叫关联? 难<span class="token generics function"><span class="token punctuation"><</span>b<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token number">42</span><span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>b<span class="token operator">></span><span class="token operator">%</span>不成我建一张<span class="token generics function"><span class="token punctuation"><</span>b<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token number">13</span><span class="token operator">%</span><span class="token operator"><</span><span class="token operator">/</span>b<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span>表格后,所有与此工艺<span class="token generics function"><span class="token punctuation"><</span>b<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token number">24</span><span class="token operator">%</span><span class="token operator"><</span><span class="token operator">/</span>b<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span>相关的表格<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span>批量勾选关联或<span class="token generics function"><span class="token punctuation"><</span>b<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token number">80</span><span class="token operator">%</span>以上<span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>b<span class="token operator">></span>表格生成实例工程,然后规划一下验收部位,再<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span>批量勾选关联或表格生成实例工程,然后规划一下验收部位,再<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>ol<span class="token operator">></span> <span class="token operator"><</span>hr border<span class="token operator">=</span><span class="token string">"2"</span> color<span class="token operator">=</span><span class="token string">"#330000"</span><span class="token operator">/</span><span class="token operator">></span> <span class="token operator"><</span>h1 id<span class="token operator">=</span><span class="token string">"test"</span><span class="token operator">></span><span class="token generics function"><span class="token punctuation"><</span>b<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>i<span class="token punctuation">></span></span>PHP灵活的高效性实现了各种终端和平台的互联网应用<span class="token operator"><</span><span class="token operator">/</span>i<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>b<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>h1<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>ol<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span>备份导出工程文件、模板文件,连关联、个人设置啥都行。<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span>备份导出工程文件、模板文件,连关联、个人设置啥都行。<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span>备份导出工程文件、模板文件,连关联、个人设置啥都行。<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span>备份导出工程文件、模板文件,连关联、个人设置啥都行。<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>ol<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>p<span class="token punctuation">></span></span> 示例随机数、<span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span>混凝土强度自动计算<span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span>、<span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span>工程概况自动填写<span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span>、<span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span>表格编辑<span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span>、<span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span>公式录入<span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span>, 这么Low的功能早就有了,资料软件必备的,还用介绍吗?批量勾选关联或表格生成实例工程,然后规划一下验收部位,再点击生成……等……等……等……完成了??? 那我还做什么?哦,打印机得去开电源了。咦,难不成其它单位工程也可以用这个实例规划生成? 爽爆了!示例随机数、混凝土强度自动计算、工程概况自动填写、表格编辑、公式录入, 这么Low的功能早就有了,<span class="token operator"><</span>font color<span class="token operator">=</span><span class="token string">"red"</span> size<span class="token operator">=</span><span class="token string">"5"</span><span class="token operator">></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>b<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>i<span class="token punctuation">></span></span>资料软件必备的,还用介绍吗<span class="token operator"><</span><span class="token operator">/</span>i<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>b<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>font<span class="token operator">></span>? <span class="token operator"><</span><span class="token operator">/</span>p<span class="token operator">></span> <span class="token operator"><</span>hr border<span class="token operator">=</span><span class="token string">"2"</span> color<span class="token operator">=</span><span class="token string">"#330000"</span><span class="token operator">/</span><span class="token operator">></span> <span class="token operator"><</span>h2 id<span class="token operator">=</span><span class="token string">"1"</span><span class="token operator">></span><span class="token generics function"><span class="token punctuation"><</span>b<span class="token punctuation">></span></span>PHP就业现状<span class="token operator"><</span><span class="token operator">/</span>b<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>h2<span class="token operator">></span> <span class="token operator"><</span>h2 id<span class="token operator">=</span><span class="token string">"2"</span><span class="token operator">></span><span class="token generics function"><span class="token punctuation"><</span>b<span class="token punctuation">></span></span>PHP就业现状<span class="token operator"><</span><span class="token operator">/</span>b<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>h2<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>p<span class="token punctuation">></span></span> 批量勾选关联或表格生成实例工程,然后规划一下验收部位,再点击生成……等……等……等……完成了??? 那我还做什么?哦,打印机得去开电源了。咦,难不成其它单位工程也可以用这个实例规划生成? 爽爆了!批量勾选关联或表格生成实例工程,然后规划一下验收部位,再点击生成……等……等……等……完成了??? 那我还做什么?哦,打印机得去开电源了。咦,难不成其它单位工程也可以用这个实例规划生成? 爽爆了!<span class="token operator"><</span><span class="token operator">/</span>p<span class="token operator">></span> <span class="token operator"><</span>hr border<span class="token operator">=</span><span class="token string">"2"</span> color<span class="token operator">=</span><span class="token string">"#330000"</span><span class="token operator">/</span><span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>h1<span class="token punctuation">></span></span>今天你要去哪里?<span class="token operator"><</span><span class="token operator">/</span>h1<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>ul<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token operator"><</span>font color<span class="token operator">=</span><span class="token string">"#0000ff"</span><span class="token operator">></span>新浪<span class="token operator"><</span><span class="token operator">/</span>font<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span><span class="token operator"><</span>br<span class="token operator">/</span><span class="token operator">></span> 什么叫关联? 难不成我建一张表格后,所有与此工艺相关的表格都会自动建立? <span class="token operator"><</span><span class="token operator">/</span>ul<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>ul<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token operator"><</span>font color<span class="token operator">=</span><span class="token string">"#0000ff"</span><span class="token operator">></span>百度<span class="token operator"><</span><span class="token operator">/</span>font<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span><span class="token operator"><</span>br<span class="token operator">/</span><span class="token operator">></span> 什么叫关联? 难不成我建一张表格后,所有与此工艺相关的表格都会自动建立? <span class="token operator"><</span><span class="token operator">/</span>ul<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>ul<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token operator"><</span>font color<span class="token operator">=</span><span class="token string">"#ff15ff"</span><span class="token operator">></span>网易<span class="token operator"><</span><span class="token operator">/</span>font<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span><span class="token operator"><</span>br<span class="token operator">/</span><span class="token operator">></span> 什么叫关联? 难不成我建一张表格后,所有与此工艺相关的表格都会自动建立? <span class="token operator"><</span><span class="token operator">/</span>ul<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>ul<span class="token punctuation">></span></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>b<span class="token punctuation">></span></span><span class="token operator"><</span>font size<span class="token operator">=</span><span class="token string">"6"</span><span class="token operator">></span>去我页面看看:<span class="token operator"><</span><span class="token operator">/</span>font<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>b<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>ul<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>ol<span class="token punctuation">></span></span> <span class="token operator"><</span>li id<span class="token operator">=</span><span class="token string">"lili"</span> <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">"class_a class_b"</span><span class="token operator">></span> <span class="token operator"><</span>a href<span class="token operator">=</span><span class="token string">"http://www.baidu.com"</span> target<span class="token operator">=</span><span class="token string">"_blank"</span><span class="token operator">></span> <span class="token operator"><</span>span <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">"a_name"</span><span class="token operator">></span> 内径 <span class="token operator"><</span><span class="token operator">/</span>span<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>a<span class="token operator">></span> <span class="token operator"><</span>a href<span class="token operator">=</span><span class="token string">"http://www.baidu"</span> target<span class="token operator">=</span><span class="token string">"_blank"</span><span class="token operator">></span> <span class="token operator"><</span>span <span class="token keyword">class</span><span class="token operator">=</span><span class="token string">"b_name"</span><span class="token operator">></span> 内径s <span class="token operator"><</span><span class="token operator">/</span>span<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>a<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token operator"><</span>font color<span class="token operator">=</span><span class="token string">"#0000ff"</span><span class="token operator">></span>page2<span class="token operator"><</span><span class="token operator">/</span>font<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span> <span class="token operator">&</span>lt表格都会自动建立<span class="token operator">&</span>gt<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token operator"><</span>font color<span class="token operator">=</span><span class="token string">"#0000ff"</span><span class="token operator">></span>page3<span class="token operator"><</span><span class="token operator">/</span>font<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span> <span class="token operator">&</span>lt表格都会自动建立<span class="token operator">&</span>gt<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span><span class="token generics function"><span class="token punctuation"><</span>u<span class="token punctuation">></span></span><span class="token operator"><</span>font color<span class="token operator">=</span><span class="token string">"#0000ff"</span><span class="token operator">></span>page4<span class="token operator"><</span><span class="token operator">/</span>font<span class="token operator">></span><span class="token operator"><</span><span class="token operator">/</span>u<span class="token operator">></span> <span class="token operator">&</span>lt表格都会自动建立<span class="token operator">&</span>gt<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token generics function"><span class="token punctuation"><</span>li<span class="token punctuation">></span></span> color<span class="token operator">=</span><span class="token string">"#0000ff"</span><span class="token operator">></span>page5 <span class="token operator">&</span>lt表格都会自动建立<span class="token operator">&</span>gt<span class="token operator"><</span><span class="token operator">/</span>li<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>ol<span class="token operator">></span> <span class="token operator"><</span>hr border<span class="token operator">=</span><span class="token string">"2"</span> color<span class="token operator">=</span><span class="token string">"#330000"</span><span class="token operator">/</span><span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>body<span class="token operator">></span> <span class="token operator"><</span><span class="token operator">/</span>html<span class="token operator">></span> </code></pre> </div> </div> </div> </div> </div> <!--PC和WAP自适应版--> <div id="SOHUCS" sid="1282533306700677120"></div> <script type="text/javascript" src="/views/front/js/chanyan.js"></script> <!-- 文章页-底部 动态广告位 --> <div class="youdao-fixed-ad" id="detail_ad_bottom"></div> </div> <div class="col-md-3"> <div class="row" id="ad"> <!-- 文章页-右侧1 动态广告位 --> <div id="right-1" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_1"> </div> </div> <!-- 文章页-右侧2 动态广告位 --> <div id="right-2" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_2"></div> </div> <!-- 文章页-右侧3 动态广告位 --> <div id="right-3" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_3"></div> </div> </div> </div> </div> </div> </div> <div class="container"> <h4 class="pt20 mb15 mt0 border-top">你可能感兴趣的:(#,爬虫)</h4> <div id="paradigm-article-related"> <div class="recommend-post mb30"> <ul class="widget-links"> <li><a href="/article/1835490218845761536.htm" title="Python爬虫解析工具之xpath使用详解" target="_blank">Python爬虫解析工具之xpath使用详解</a> <span class="text-muted">eqa11</span> <a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a> <div>文章目录Python爬虫解析工具之xpath使用详解一、引言二、环境准备1、插件安装2、依赖库安装三、xpath语法详解1、路径表达式2、通配符3、谓语4、常用函数四、xpath在Python代码中的使用1、文档树的创建2、使用xpath表达式3、获取元素内容和属性五、总结Python爬虫解析工具之xpath使用详解一、引言在Python爬虫开发中,数据提取是一个至关重要的环节。xpath作为一门</div> </li> <li><a href="/article/1835483159630802944.htm" title="nosql数据库技术与应用知识点" target="_blank">nosql数据库技术与应用知识点</a> <span class="text-muted">皆过客,揽星河</span> <a class="tag" taget="_blank" href="/search/NoSQL/1.htm">NoSQL</a><a class="tag" taget="_blank" href="/search/nosql/1.htm">nosql</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90/1.htm">数据分析</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/1.htm">数据结构</a><a class="tag" taget="_blank" href="/search/%E9%9D%9E%E5%85%B3%E7%B3%BB%E5%9E%8B%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">非关系型数据库</a> <div>Nosql知识回顾大数据处理流程数据采集(flume、爬虫、传感器)数据存储(本门课程NoSQL所处的阶段)Hdfs、MongoDB、HBase等数据清洗(入仓)Hive等数据处理、分析(Spark、Flink等)数据可视化数据挖掘、机器学习应用(Python、SparkMLlib等)大数据时代存储的挑战(三高)高并发(同一时间很多人访问)高扩展(要求随时根据需求扩展存储)高效率(要求读写速度快)</div> </li> <li><a href="/article/1835454921990828032.htm" title="Java爬虫框架(一)--架构设计" target="_blank">Java爬虫框架(一)--架构设计</a> <span class="text-muted">狼图腾-狼之传说</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E6%A1%86%E6%9E%B6/1.htm">框架</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E4%BB%BB%E5%8A%A1/1.htm">任务</a><a class="tag" taget="_blank" href="/search/html%E8%A7%A3%E6%9E%90%E5%99%A8/1.htm">html解析器</a><a class="tag" taget="_blank" href="/search/%E5%AD%98%E5%82%A8/1.htm">存储</a><a class="tag" taget="_blank" href="/search/%E7%94%B5%E5%AD%90%E5%95%86%E5%8A%A1/1.htm">电子商务</a> <div>一、架构图那里搜网络爬虫框架主要针对电子商务网站进行数据爬取,分析,存储,索引。爬虫:爬虫负责爬取,解析,处理电子商务网站的网页的内容数据库:存储商品信息索引:商品的全文搜索索引Task队列:需要爬取的网页列表Visited表:已经爬取过的网页列表爬虫监控平台:web平台可以启动,停止爬虫,管理爬虫,task队列,visited表。二、爬虫1.流程1)Scheduler启动爬虫器,TaskMast</div> </li> <li><a href="/article/1835454543471669248.htm" title="Java:爬虫框架" target="_blank">Java:爬虫框架</a> <span class="text-muted">dingcho</span> <a class="tag" taget="_blank" href="/search/Java/1.htm">Java</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a> <div>一、ApacheNutch2【参考地址】Nutch是一个开源Java实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。包括全文搜索和Web爬虫。Nutch致力于让每个人能很容易,同时花费很少就可以配置世界一流的Web搜索引擎.为了完成这一宏伟的目标,Nutch必须能够做到:每个月取几十亿网页为这些网页维护一个索引对索引文件进行每秒上千次的搜索提供高质量的搜索结果简单来说Nutch支持分</div> </li> <li><a href="/article/1835438028009598976.htm" title="WebMagic:强大的Java爬虫框架解析与实战" target="_blank">WebMagic:强大的Java爬虫框架解析与实战</a> <span class="text-muted">Aaron_945</span> <a class="tag" taget="_blank" href="/search/Java/1.htm">Java</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a> <div>文章目录引言官网链接WebMagic原理概述基础使用1.添加依赖2.编写PageProcessor高级使用1.自定义Pipeline2.分布式抓取优点结论引言在大数据时代,网络爬虫作为数据收集的重要工具,扮演着不可或缺的角色。Java作为一门广泛使用的编程语言,在爬虫开发领域也有其独特的优势。WebMagic是一个开源的Java爬虫框架,它提供了简单灵活的API,支持多线程、分布式抓取,以及丰富的</div> </li> <li><a href="/article/1835435506645692416.htm" title="00. 这里整理了最全的爬虫框架(Java + Python)" target="_blank">00. 这里整理了最全的爬虫框架(Java + Python)</a> <span class="text-muted">有一只柴犬</span> <a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB%E7%B3%BB%E5%88%97/1.htm">爬虫系列</a><a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a> <div>目录1、前言2、什么是网络爬虫3、常见的爬虫框架3.1、java框架3.1.1、WebMagic3.1.2、Jsoup3.1.3、HttpClient3.1.4、Crawler4j3.1.5、HtmlUnit3.1.6、Selenium3.2、Python框架3.2.1、Scrapy3.2.2、BeautifulSoup+Requests3.2.3、Selenium3.2.4、PyQuery3.2</div> </li> <li><a href="/article/1835412560413814784.htm" title="python爬取微信小程序数据,python爬取小程序数据" target="_blank">python爬取微信小程序数据,python爬取小程序数据</a> <span class="text-muted">2301_81900439</span> <a class="tag" taget="_blank" href="/search/%E5%89%8D%E7%AB%AF/1.htm">前端</a> <div>大家好,小编来为大家解答以下问题,python爬取微信小程序数据,python爬取小程序数据,现在让我们一起来看看吧!Python爬虫系列之微信小程序实战基于Scrapy爬虫框架实现对微信小程序数据的爬取首先,你得需要安装抓包工具,这里推荐使用Charles,至于怎么使用后期有时间我会出一个事例最重要的步骤之一就是分析接口,理清楚每一个接口功能,然后连接起来形成接口串思路,再通过Spider的回调</div> </li> <li><a href="/article/1835347005522669568.htm" title="大模型训练数据库Common Crawl" target="_blank">大模型训练数据库Common Crawl</a> <span class="text-muted">WindyChanChan</span> <a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E9%9B%86/1.htm">数据集</a><a class="tag" taget="_blank" href="/search/%E8%AF%AD%E8%A8%80%E6%A8%A1%E5%9E%8B/1.htm">语言模型</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a> <div>CommonCrawl介绍‌‌CommonCrawl是一个非营利组织,致力于通过大规模分布式爬虫系统定期抓取整个Web并将其存储在一个可公开访问的数据库中。CommonCrawl的数据收集和处理过程包括使用Python开源爬虫工具收集全球范围内的网站数据,并将其上传到‌CommonCrawl基金会的数据仓库中。该项目从2008年开始,至今已经积累了大量的原始网页数据、元数据和文本提取数据。这些数据</div> </li> <li><a href="/article/1835342718067372032.htm" title="Python精选200Tips:121-125" target="_blank">Python精选200Tips:121-125</a> <span class="text-muted">AnFany</span> <a class="tag" taget="_blank" href="/search/Python200%2BTips/1.htm">Python200+Tips</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a> <div>Spendyourtimeonself-improvement121Requests-简化的HTTP请求处理发送GET请求发送POST请求发送PUT请求发送DELETE请求会话管理处理超时文件上传122BeautifulSoup-网页解析和抓取解析HTML和XML文档查找单个标签查找多个标签使用CSS选择器查找标签提取文本修改文档内容删除标签处理XML文档123Scrapy-强大的网络爬虫框架示例</div> </li> <li><a href="/article/1835333520919195648.htm" title="爬虫技术抓取网站数据被限制怎么处理" target="_blank">爬虫技术抓取网站数据被限制怎么处理</a> <span class="text-muted">Bearjumpingcandy</span> <a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a> <div>爬虫技术用于抓取网站数据时,可能会遇到一些限制,常见的包括反爬机制、速率限制、IP封禁等。以下是应对这些情况的一些策略:尊重robots.txt:每个网站都有robots.txt文件,遵循其中的规定可以避免触犯网站的抓取规则。设置合理频率:控制爬虫请求的速度,通过添加延迟或使用代理服务器,减少对目标网站的压力。使用代理:获取并使用代理IP地址可以更换访问来源,降低被识别的可能性。模拟用户行为:使用</div> </li> <li><a href="/article/1835333267952332800.htm" title="网站推广爬虫" target="_blank">网站推广爬虫</a> <span class="text-muted">Bearjumpingcandy</span> <a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a> <div>网站推广爬虫是一种用于升网站曝光度和推广效果的工具。它通过自动化地访问和收集网站信息,从而实现对目标网站的广告、关键词、排名等数据进行分析和优化。以下是网站推广爬虫的一些介绍:数据收集:网站推广爬虫可以自动访问目标网站,并收集相关的数据,如网站流量、关键词排名、竞争对手信息等。这些数据可以帮助网站推广人员了解网站的现状和竞争环境,从而制定相应的推广策略。关键词优化:通过分析搜索引擎的关键词排名情况</div> </li> <li><a href="/article/1835333268375957504.htm" title="爬虫技术抓取网站数据" target="_blank">爬虫技术抓取网站数据</a> <span class="text-muted">Bearjumpingcandy</span> <a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a> <div>爬虫技术是一种自动化获取网站数据的技术,它可以模拟人类浏览器的行为,访问网页并提取所需的信息。以下是爬虫技术抓取网站数据的一般步骤:发起HTTP请求:爬虫首先会发送HTTP请求到目标网站,获取网页的内容。解析HTML:获取到网页内容后,爬虫会使用HTML解析器解析HTML代码,提取出需要的数据。数据提取:通过使用XPath、CSS选择器或正则表达式等工具,爬虫可以从HTML中提取出所需的数据,如文</div> </li> <li><a href="/article/1835333268858302464.htm" title="爬虫技术抓取网站数据" target="_blank">爬虫技术抓取网站数据</a> <span class="text-muted">Bearjumpingcandy</span> <a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a> <div>爬虫技术是指通过程序自动访问网页并提取数据的技术。一般来说,爬虫技术包含以下几个步骤:确定目标网站:确定需要抓取的网站,并了解其页面结构和数据特点。分析页面结构:分析网页的结构和源代码,找到需要抓取的数据在页面中的位置和标识。编写爬虫程序:使用编程语言(如Python)编写爬虫程序,实现对目标网站的自动访问和数据提取。处理抓取数据:对抓取到的数据进行清洗、去重、整合等处理,以便后续的分析和利用。爬</div> </li> <li><a href="/article/1835332888674004992.htm" title="爬虫之隧道代理:如何在爬虫中使用代理IP?" target="_blank">爬虫之隧道代理:如何在爬虫中使用代理IP?</a> <span class="text-muted">2401_87251497</span> <a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a><a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a><a class="tag" taget="_blank" href="/search/%E7%BD%91%E7%BB%9C/1.htm">网络</a><a class="tag" taget="_blank" href="/search/tcp%2Fip/1.htm">tcp/ip</a><a class="tag" taget="_blank" href="/search/%E7%BD%91%E7%BB%9C%E5%8D%8F%E8%AE%AE/1.htm">网络协议</a> <div>在进行网络爬虫时,使用代理IP是一种常见的方式来绕过网站的反爬虫机制,提高爬取效率和数据质量。本文将详细介绍如何在爬虫中使用隧道代理,包括其原理、优势以及具体的实现方法。无论您是爬虫新手还是有经验的开发者,这篇文章都将为您提供实用的指导。什么是隧道代理?隧道代理是一种高级的代理技术,它通过创建一个加密的隧道,将数据从客户端传输到代理服务器,再由代理服务器转发到目标服务器。这样不仅可以隐藏客户端的真</div> </li> <li><a href="/article/1835288964056051712.htm" title="分享一个基于python的电子书数据采集与可视化分析 hadoop电子书数据分析与推荐系统 spark大数据毕设项目(源码、调试、LW、开题、PPT)" target="_blank">分享一个基于python的电子书数据采集与可视化分析 hadoop电子书数据分析与推荐系统 spark大数据毕设项目(源码、调试、LW、开题、PPT)</a> <span class="text-muted">计算机源码社</span> <a class="tag" taget="_blank" href="/search/Python%E9%A1%B9%E7%9B%AE/1.htm">Python项目</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/hadoop/1.htm">hadoop</a><a class="tag" taget="_blank" href="/search/%E8%AE%A1%E7%AE%97%E6%9C%BA%E6%AF%95%E4%B8%9A%E8%AE%BE%E8%AE%A1%E9%80%89%E9%A2%98/1.htm">计算机毕业设计选题</a><a class="tag" taget="_blank" href="/search/%E8%AE%A1%E7%AE%97%E6%9C%BA%E6%AF%95%E4%B8%9A%E8%AE%BE%E8%AE%A1%E6%BA%90%E7%A0%81/1.htm">计算机毕业设计源码</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90/1.htm">数据分析</a><a class="tag" taget="_blank" href="/search/spark%E6%AF%95%E8%AE%BE/1.htm">spark毕设</a> <div>作者:计算机源码社个人简介:本人八年开发经验,擅长Java、Python、PHP、.NET、Node.js、Android、微信小程序、爬虫、大数据、机器学习等,大家有这一块的问题可以一起交流!学习资料、程序开发、技术解答、文档报告如需要源码,可以扫取文章下方二维码联系咨询Java项目微信小程序项目Android项目Python项目PHP项目ASP.NET项目Node.js项目选题推荐项目实战|p</div> </li> <li><a href="/article/1835270188086423552.htm" title="python抓取网页内容401应该用哪个库_python3使用requests模块爬取页面内容入门" target="_blank">python抓取网页内容401应该用哪个库_python3使用requests模块爬取页面内容入门</a> <span class="text-muted">坂田月半</span> <div>python的爬虫相关模块有很多,除了requests模块,再如urllib和pycurl以及tornado等。相比而言,requests模块是相对简单易上手的。通过文本,大家可以迅速学会使用python的requests模块爬取页码内容。1.Requests唯一的一个非转基因的PythonHTTP库,人类可以安全享用。官网:http://cn.python-requests.org/zh_CN/</div> </li> <li><a href="/article/1835257575277424640.htm" title="【Python爬虫】百度百科词条内容" target="_blank">【Python爬虫】百度百科词条内容</a> <span class="text-muted">PokiFighting</span> <a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86/1.htm">数据处理</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a> <div>词条内容我这里随便选取了一个链接,用的是FBI的词条importurllib.requestimporturllib.parsefromlxmlimportetreedefquery(url):headers={'user-agent':'Mozilla/5.0(WindowsNT6.1;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/80.</div> </li> <li><a href="/article/1835253670858551296.htm" title="爬虫和代理IP的关系" target="_blank">爬虫和代理IP的关系</a> <span class="text-muted">xiaoxiongip666</span> <a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a><a class="tag" taget="_blank" href="/search/tcp%2Fip/1.htm">tcp/ip</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a> <div>爬虫和代理IP之间的关系是相互依存的。代理IP为爬虫提供了绕过IP限制、隐藏真实IP、提高访问速度等能力,使得爬虫能够更有效地进行数据抓取。然而,在使用时也需要注意合法性、稳定性、成本以及隐私保护等问题。</div> </li> <li><a href="/article/1835219887434330112.htm" title="python语言爬虫爬取歌曲程序代码" target="_blank">python语言爬虫爬取歌曲程序代码</a> <span class="text-muted">EYYLTV</span> <a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a><a class="tag" taget="_blank" href="/search/android/1.htm">android</a> <div>importrequestssong_urls=[“http://music.163.com/song/media/outer/url?id=25795016.mp3”,“https://m703.music.126.net/20240915140140/670dfe5c0144991d4cb778d6662fd762/jd-musicrep-privatecloud-audio-public/o</div> </li> <li><a href="/article/1835219887958618112.htm" title="python语言爬虫爬取歌曲代码X" target="_blank">python语言爬虫爬取歌曲代码X</a> <span class="text-muted">EYYLTV</span> <a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a> <div>importrequestssong_urls=[“https://m804.music.126.net/20240915142147/4e01caa69abda60b165e185607805ee1/jdyyaac/obj/w5rDlsOJwrLDjj7CmsOj/30379084686/b56a/dbd5/39fc/792d87f5d7014bb78547ec3804eeaac5.m4a?au</div> </li> <li><a href="/article/1835198462984024064.htm" title="拼多多商家电话采集工具 爬虫教程分享" target="_blank">拼多多商家电话采集工具 爬虫教程分享</a> <span class="text-muted">小电商达人</span> <a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a> <div>以下是使用Python编写的拼多多商家电话采集爬虫教程:一、前期准备安装Python:从Python官方网站下载并安装最新版本的Python,安装过程中注意勾选将Python添加到系统路径选项。安装相关库:在命令提示符中运行以下命令来安装所需的库。pipinstallrequests:用于发送HTTP请求获取网页内容。pipinstallbeautifulsoup4:用于解析HTML页面。二、分析</div> </li> <li><a href="/article/1835157319500001280.htm" title="Python爬虫代理池" target="_blank">Python爬虫代理池</a> <span class="text-muted">极客李华</span> <a class="tag" taget="_blank" href="/search/python%E6%8E%88%E8%AF%BE/1.htm">python授课</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a> <div>Python爬虫代理池网络爬虫在数据采集和信息抓取方面起到了关键作用。然而,为了应对网站的反爬虫机制和保护爬虫的真实身份,使用代理池变得至关重要。1.代理池的基本概念:代理池是一组包含多个代理IP地址的集合。通过在爬虫中使用代理池,我们能够隐藏爬虫的真实IP地址,实现一定程度的匿名性。这有助于防止被目标网站封锁或限制访问频率。2.为何使用代理池:匿名性:代理池允许爬虫在请求目标网站时使用不同的IP</div> </li> <li><a href="/article/1835143079305244672.htm" title="大数据毕业设计hadoop+spark+hive知识图谱租房数据分析可视化大屏 租房推荐系统 58同城租房爬虫 房源推荐系统 房价预测系统 计算机毕业设计 机器学习 深度学习 人工智能" target="_blank">大数据毕业设计hadoop+spark+hive知识图谱租房数据分析可视化大屏 租房推荐系统 58同城租房爬虫 房源推荐系统 房价预测系统 计算机毕业设计 机器学习 深度学习 人工智能</a> <span class="text-muted">2401_84572577</span> <a class="tag" taget="_blank" href="/search/%E7%A8%8B%E5%BA%8F%E5%91%98/1.htm">程序员</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a><a class="tag" taget="_blank" href="/search/hadoop/1.htm">hadoop</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a> <div>做了那么多年开发,自学了很多门编程语言,我很明白学习资源对于学一门新语言的重要性,这些年也收藏了不少的Python干货,对我来说这些东西确实已经用不到了,但对于准备自学Python的人来说,或许它就是一个宝藏,可以给你省去很多的时间和精力。别在网上瞎学了,我最近也做了一些资源的更新,只要你是我的粉丝,这期福利你都可拿走。我先来介绍一下这些东西怎么用,文末抱走。(1)Python所有方向的学习路线(</div> </li> <li><a href="/article/1835067814621310976.htm" title="10个高效的Python爬虫框架,你用过几个?" target="_blank">10个高效的Python爬虫框架,你用过几个?</a> <span class="text-muted">进击的C语言</span> <a class="tag" taget="_blank" href="/search/python/1.htm">python</a> <div>小型爬虫需求,requests库+bs4库就能解决;大型爬虫数据,尤其涉及异步抓取、内容管理及后续扩展等功能时,就需要用到爬虫框架了。下面介绍了10个爬虫框架,大家可以学习使用!1.Scrapyscrapy官网:https://scrapy.org/scrapy中文文档:https://www.osgeo.cn/scrapy/intro/oScrapy是一个为了爬取网站数据,提取结构性数据而编写的</div> </li> <li><a href="/article/1835007168928116736.htm" title="python爬虫(5)之CSDN" target="_blank">python爬虫(5)之CSDN</a> <span class="text-muted">It is a deal️</span> <a class="tag" taget="_blank" href="/search/%E5%B0%8F%E9%A1%B9%E7%9B%AE/1.htm">小项目</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/json/1.htm">json</a><a class="tag" taget="_blank" href="/search/%E7%88%AC%E8%99%AB/1.htm">爬虫</a> <div>CSDN的爬虫相对于doubatop250更加简单,一般只需要title和url即可下面是相关的代码:#爬虫之csdn#分析urlhttps://www.csdn.net/api/articles?type=more&category=python&shown_offset=0(firstpage)#https://www.csdn.net/api/articles?type=more&categ</div> </li> <li><a href="/article/1835005152646492160.htm" title="python学习第七节:正则表达式" target="_blank">python学习第七节:正则表达式</a> <span class="text-muted">一只会敲代码的小灰灰</span> <a class="tag" taget="_blank" href="/search/python%E5%AD%A6%E4%B9%A0/1.htm">python学习</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%AD%A6%E4%B9%A0/1.htm">学习</a><a class="tag" taget="_blank" href="/search/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F/1.htm">正则表达式</a> <div>python学习第七节:正则表达式正则表达式基本上在所有开发语言中都会使用到,在python中尤为重要。当我们使用python开发爬虫程序将目标网页扒下来之后我们要从网页中解析出我们想要的信息,这个时候就需要正则表达式去进行匹配。importrere的常量re模块中有9个常量,常量的值都是int类型!(知道就行)修饰符描述re.l使匹配对大小写不敏感re.L做本地化识别(locale-aware)</div> </li> <li><a href="/article/1834965554214039552.htm" title="分布式框架Celery七(Django-Celery-Flower实现异步和定时爬虫及其监控邮件告警)" target="_blank">分布式框架Celery七(Django-Celery-Flower实现异步和定时爬虫及其监控邮件告警)</a> <span class="text-muted">yjjpp2301</span> <a class="tag" taget="_blank" href="/search/Celery/1.htm">Celery</a><a class="tag" taget="_blank" href="/search/%E5%88%86%E5%B8%83%E5%BC%8F/1.htm">分布式</a><a class="tag" taget="_blank" href="/search/django/1.htm">django</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%90%8E%E7%AB%AF/1.htm">后端</a> <div>Django中集成方式安装模块pipinstallDjango==3.2.22pipinstallcelerypipinstallredispipinstalleventlet#在windows环境下需要安装eventlet包-----------pipinstalldjango-celery-beatpipinstalldjango-celery-resultspipinstalldjango-</div> </li> <li><a href="/article/1834960888273137664.htm" title="生产者消费者模式_Labview基础之生产者消费者设计模式(事件)" target="_blank">生产者消费者模式_Labview基础之生产者消费者设计模式(事件)</a> <span class="text-muted">weixin_39532699</span> <a class="tag" taget="_blank" href="/search/%E7%94%9F%E4%BA%A7%E8%80%85%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%BC%8F/1.htm">生产者消费者模式</a> <div>1绪论近期,开了一个QQ群,刚开始的目的也是想多拉写软件相关的大神,有问题的时候也可以交流交流。记得当时有个软件在写的时候遇到了一个棘手的问题,outlook邮箱配置账户密码的问题,到现在也没解决,算了,也不是很迫切。2000人群就留在那里爬虫发单吧!建群以后才发现,原来这一块的小白还挺多,总结起来就一个原因:做这个软件的大多数都不是软件出生,都是因为临时要搭建一个上位机平台,匆匆入门......</div> </li> <li><a href="/article/1834943236649611264.htm" title="Python——爬虫" target="_blank">Python——爬虫</a> <span class="text-muted">星和月</span> <a class="tag" taget="_blank" href="/search/python/1.htm">python</a> <div>当编写一个Python爬虫时,你可以使用BeautifulSoup库来解析网页内容,使用requests库来获取网页的HTML代码。下面是一个简单的示例,演示了如何获取并解析网页内容:importrequestsfrombs4importBeautifulSoup#发送HTTP请求获取网页内容url='https://www.example.com'#要爬取的网页的URLresponse=requ</div> </li> <li><a href="/article/1834807218839580672.htm" title="Python数据分析之股票信息可视化实现matplotlib" target="_blank">Python数据分析之股票信息可视化实现matplotlib</a> <span class="text-muted">Blogfish</span> <a class="tag" taget="_blank" href="/search/Python3/1.htm">Python3</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%8F%AF%E8%A7%86%E5%8C%96/1.htm">可视化</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90/1.htm">数据分析</a> <div>今天学习爬虫技术数据分析对于股票信息的分析及结果呈现,目标是实现对股票信息的爬取并对数据整理后,生成近期成交量折线图。首先,做这个案例一定要有一个明确的思路。知道要干啥,知道用哪些知识,有些方法我也记不住百度下知识库很强大,肯定有答案。有思路以后准备对数据处理,就是几个方法使用了。接口地址参考:Tushare数据涉及知识库:tushare-一个财经数据开放接口;pandas-实现将数据整理为表格,</div> </li> <li><a href="/article/40.htm" title="java线程Thread和Runnable区别和联系" target="_blank">java线程Thread和Runnable区别和联系</a> <span class="text-muted">zx_code</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/jvm/1.htm">jvm</a><a class="tag" taget="_blank" href="/search/thread/1.htm">thread</a><a class="tag" taget="_blank" href="/search/%E5%A4%9A%E7%BA%BF%E7%A8%8B/1.htm">多线程</a><a class="tag" taget="_blank" href="/search/Runnable/1.htm">Runnable</a> <div>我们都晓得java实现线程2种方式,一个是继承Thread,另一个是实现Runnable。 模拟窗口买票,第一例子继承thread,代码如下 package thread; public class ThreadTest { public static void main(String[] args) { Thread1 t1 = new Thread1(</div> </li> <li><a href="/article/167.htm" title="【转】JSON与XML的区别比较" target="_blank">【转】JSON与XML的区别比较</a> <span class="text-muted">丁_新</span> <a class="tag" taget="_blank" href="/search/json/1.htm">json</a><a class="tag" taget="_blank" href="/search/xml/1.htm">xml</a> <div>1.定义介绍 (1).XML定义 扩展标记语言 (Extensible Markup Language, XML) ,用于标记电子文件使其具有结构性的标记语言,可以用来标记数据、定义数据类型,是一种允许用户对自己的标记语言进行定义的源语言。 XML使用DTD(document type definition)文档类型定义来组织数据;格式统一,跨平台和语言,早已成为业界公认的标准。 XML是标</div> </li> <li><a href="/article/294.htm" title="c++ 实现五种基础的排序算法" target="_blank">c++ 实现五种基础的排序算法</a> <span class="text-muted">CrazyMizzz</span> <a class="tag" taget="_blank" href="/search/C%2B%2B/1.htm">C++</a><a class="tag" taget="_blank" href="/search/c/1.htm">c</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a> <div>#include<iostream> using namespace std; //辅助函数,交换两数之值 template<class T> void mySwap(T &x, T &y){ T temp = x; x = y; y = temp; } const int size = 10; //一、用直接插入排</div> </li> <li><a href="/article/421.htm" title="我的软件" target="_blank">我的软件</a> <span class="text-muted">麦田的设计者</span> <a class="tag" taget="_blank" href="/search/%E6%88%91%E7%9A%84%E8%BD%AF%E4%BB%B6/1.htm">我的软件</a><a class="tag" taget="_blank" href="/search/%E9%9F%B3%E4%B9%90%E7%B1%BB/1.htm">音乐类</a><a class="tag" taget="_blank" href="/search/%E5%A8%B1%E4%B9%90/1.htm">娱乐</a><a class="tag" taget="_blank" href="/search/%E6%94%BE%E6%9D%BE/1.htm">放松</a> <div>     这是我写的一款app软件,耗时三个月,是一个根据央视节目开门大吉改变的,提供音调,猜歌曲名。1、手机拥有者在android手机市场下载本APP,同意权限,安装到手机上。2、游客初次进入时会有引导页面提醒用户注册。(同时软件自动播放背景音乐)。3、用户登录到主页后,会有五个模块。a、点击不胫而走,用户得到开门大吉首页部分新闻,点击进入有新闻详情。b、</div> </li> <li><a href="/article/548.htm" title="linux awk命令详解" target="_blank">linux awk命令详解</a> <span class="text-muted">被触发</span> <a class="tag" taget="_blank" href="/search/linux+awk/1.htm">linux awk</a> <div>awk是行处理器: 相比较屏幕处理的优点,在处理庞大文件时不会出现内存溢出或是处理缓慢的问题,通常用来格式化文本信息 awk处理过程: 依次对每一行进行处理,然后输出 awk命令形式: awk [-F|-f|-v] ‘BEGIN{} //{command1; command2} END{}’ file [-F|-f|-v]大参数,-F指定分隔符,-f调用脚本,-v定义变量 var=val</div> </li> <li><a href="/article/675.htm" title="各种语言比较" target="_blank">各种语言比较</a> <span class="text-muted">_wy_</span> <a class="tag" taget="_blank" href="/search/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/1.htm">编程语言</a> <div>                    Java Ruby PHP 擅长领域                  </div> </li> <li><a href="/article/802.htm" title="oracle 中数据类型为clob的编辑" target="_blank">oracle 中数据类型为clob的编辑</a> <span class="text-muted">知了ing</span> <a class="tag" taget="_blank" href="/search/oracle+clob/1.htm">oracle clob</a> <div>public void updateKpiStatus(String kpiStatus,String taskId){ Connection dbc=null; Statement stmt=null; PreparedStatement ps=null; try { dbc = new DBConn().getNewConnection(); //stmt = db</div> </li> <li><a href="/article/929.htm" title="分布式服务框架 Zookeeper -- 管理分布式环境中的数据" target="_blank">分布式服务框架 Zookeeper -- 管理分布式环境中的数据</a> <span class="text-muted">矮蛋蛋</span> <a class="tag" taget="_blank" href="/search/zookeeper/1.htm">zookeeper</a> <div>原文地址: http://www.ibm.com/developerworks/cn/opensource/os-cn-zookeeper/ 安装和配置详解 本文介绍的 Zookeeper 是以 3.2.2 这个稳定版本为基础,最新的版本可以通过官网 http://hadoop.apache.org/zookeeper/来获取,Zookeeper 的安装非常简单,下面将从单机模式和集群模式两</div> </li> <li><a href="/article/1056.htm" title="tomcat数据源" target="_blank">tomcat数据源</a> <span class="text-muted">alafqq</span> <a class="tag" taget="_blank" href="/search/tomcat/1.htm">tomcat</a> <div>数据库 JNDI(Java Naming and Directory Interface,Java命名和目录接口)是一组在Java应用中访问命名和目录服务的API。 没有使用JNDI时我用要这样连接数据库: 03.  Class.forName("com.mysql.jdbc.Driver");  04.  conn</div> </li> <li><a href="/article/1183.htm" title="遍历的方法" target="_blank">遍历的方法</a> <span class="text-muted">百合不是茶</span> <a class="tag" taget="_blank" href="/search/%E9%81%8D%E5%8E%86/1.htm">遍历</a> <div>                                                      遍历 在java的泛</div> </li> <li><a href="/article/1310.htm" title="linux查看硬件信息的命令" target="_blank">linux查看硬件信息的命令</a> <span class="text-muted">bijian1013</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>linux查看硬件信息的命令 一.查看CPU: cat /proc/cpuinfo   二.查看内存: free   三.查看硬盘: df   linux下查看硬件信息 1、lspci 列出所有PCI 设备; lspci - list all PCI devices:列出机器中的PCI设备(声卡、显卡、Modem、网卡、USB、主板集成设备也能</div> </li> <li><a href="/article/1437.htm" title="java常见的ClassNotFoundException" target="_blank">java常见的ClassNotFoundException</a> <span class="text-muted">bijian1013</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a> <div>1.java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory   添加包common-logging.jar2.java.lang.ClassNotFoundException: javax.transaction.Synchronization    </div> </li> <li><a href="/article/1564.htm" title="【Gson五】日期对象的序列化和反序列化" target="_blank">【Gson五】日期对象的序列化和反序列化</a> <span class="text-muted">bit1129</span> <a class="tag" taget="_blank" href="/search/%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96/1.htm">反序列化</a> <div>对日期类型的数据进行序列化和反序列化时,需要考虑如下问题:   1. 序列化时,Date对象序列化的字符串日期格式如何 2. 反序列化时,把日期字符串序列化为Date对象,也需要考虑日期格式问题 3. Date A -> str -> Date B,A和B对象是否equals   默认序列化和反序列化     import com</div> </li> <li><a href="/article/1691.htm" title="【Spark八十六】Spark Streaming之DStream vs. InputDStream" target="_blank">【Spark八十六】Spark Streaming之DStream vs. InputDStream</a> <span class="text-muted">bit1129</span> <a class="tag" taget="_blank" href="/search/Stream/1.htm">Stream</a> <div>  1. DStream的类说明文档:   /** * A Discretized Stream (DStream), the basic abstraction in Spark Streaming, is a continuous * sequence of RDDs (of the same type) representing a continuous st</div> </li> <li><a href="/article/1818.htm" title="通过nginx获取header信息" target="_blank">通过nginx获取header信息</a> <span class="text-muted">ronin47</span> <a class="tag" taget="_blank" href="/search/nginx+header/1.htm">nginx header</a> <div>1. 提取整个的Cookies内容到一个变量,然后可以在需要时引用,比如记录到日志里面, if ( $http_cookie ~* "(.*)$") {         set $all_cookie $1; }     变量$all_cookie就获得了cookie的值,可以用于运算了 </div> </li> <li><a href="/article/1945.htm" title="java-65.输入数字n,按顺序输出从1最大的n位10进制数。比如输入3,则输出1、2、3一直到最大的3位数即999" target="_blank">java-65.输入数字n,按顺序输出从1最大的n位10进制数。比如输入3,则输出1、2、3一直到最大的3位数即999</a> <span class="text-muted">bylijinnan</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a> <div>参考了网上的http://blog.csdn.net/peasking_dd/article/details/6342984 写了个java版的: public class Print_1_To_NDigit { /** * Q65.输入数字n,按顺序输出从1最大的n位10进制数。比如输入3,则输出1、2、3一直到最大的3位数即999 * 1.使用字符串</div> </li> <li><a href="/article/2072.htm" title="Netty源码学习-ReplayingDecoder" target="_blank">Netty源码学习-ReplayingDecoder</a> <span class="text-muted">bylijinnan</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/netty/1.htm">netty</a> <div>ReplayingDecoder是FrameDecoder的子类,不熟悉FrameDecoder的,可以先看看 http://bylijinnan.iteye.com/blog/1982618 API说,ReplayingDecoder简化了操作,比如: FrameDecoder在decode时,需要判断数据是否接收完全: public class IntegerH</div> </li> <li><a href="/article/2199.htm" title="js特殊字符过滤" target="_blank">js特殊字符过滤</a> <span class="text-muted">cngolon</span> <a class="tag" taget="_blank" href="/search/js%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6/1.htm">js特殊字符</a><a class="tag" taget="_blank" href="/search/js%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6%E8%BF%87%E6%BB%A4/1.htm">js特殊字符过滤</a> <div>1.js中用正则表达式 过滤特殊字符, 校验所有输入域是否含有特殊符号function stripscript(s) {    var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()&mdash;—|{}【】‘;:”“'。,、?]"</div> </li> <li><a href="/article/2326.htm" title="hibernate使用sql查询" target="_blank">hibernate使用sql查询</a> <span class="text-muted">ctrain</span> <a class="tag" taget="_blank" href="/search/Hibernate/1.htm">Hibernate</a> <div> import java.util.Iterator; import java.util.List; import java.util.Map; import org.hibernate.Hibernate; import org.hibernate.SQLQuery; import org.hibernate.Session; import org.hibernate.Transa</div> </li> <li><a href="/article/2453.htm" title="linux shell脚本中切换用户执行命令方法" target="_blank">linux shell脚本中切换用户执行命令方法</a> <span class="text-muted">daizj</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/shell/1.htm">shell</a><a class="tag" taget="_blank" href="/search/%E5%91%BD%E4%BB%A4/1.htm">命令</a><a class="tag" taget="_blank" href="/search/%E5%88%87%E6%8D%A2%E7%94%A8%E6%88%B7/1.htm">切换用户</a> <div>经常在写shell脚本时,会碰到要以另外一个用户来执行相关命令,其方法简单记下:   1、执行单个命令:su - user -c "command" 如:下面命令是以test用户在/data目录下创建test123目录 [root@slave19 /data]# su - test -c "mkdir /data/test123" </div> </li> <li><a href="/article/2580.htm" title="好的代码里只要一个 return 语句" target="_blank">好的代码里只要一个 return 语句</a> <span class="text-muted">dcj3sjt126com</span> <a class="tag" taget="_blank" href="/search/return/1.htm">return</a> <div>别再这样写了:public boolean foo() {    if (true) {         return true;     } else {          return false;    </div> </li> <li><a href="/article/2707.htm" title="Android动画效果学习" target="_blank">Android动画效果学习</a> <span class="text-muted">dcj3sjt126com</span> <a class="tag" taget="_blank" href="/search/android/1.htm">android</a> <div>1、透明动画效果 方法一:代码实现 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, fals</div> </li> <li><a href="/article/2834.htm" title="linux复习笔记之bash shell (4)管道命令" target="_blank">linux复习笔记之bash shell (4)管道命令</a> <span class="text-muted">eksliang</span> <a class="tag" taget="_blank" href="/search/linux%E7%AE%A1%E9%81%93%E5%91%BD%E4%BB%A4%E6%B1%87%E6%80%BB/1.htm">linux管道命令汇总</a><a class="tag" taget="_blank" href="/search/linux%E7%AE%A1%E9%81%93%E5%91%BD%E4%BB%A4/1.htm">linux管道命令</a><a class="tag" taget="_blank" href="/search/linux%E5%B8%B8%E7%94%A8%E7%AE%A1%E9%81%93%E5%91%BD%E4%BB%A4/1.htm">linux常用管道命令</a> <div>转载请出自出处: http://eksliang.iteye.com/blog/2105461     bash命令执行的完毕以后,通常这个命令都会有返回结果,怎么对这个返回的结果做一些操作呢?那就得用管道命令‘|’。     上面那段话,简单说了下管道命令的作用,那什么事管道命令呢?     答:非常的经典的一句话,记住了,何为管</div> </li> <li><a href="/article/2961.htm" title="Android系统中自定义按键的短按、双击、长按事件" target="_blank">Android系统中自定义按键的短按、双击、长按事件</a> <span class="text-muted">gqdy365</span> <a class="tag" taget="_blank" href="/search/android/1.htm">android</a> <div>在项目中碰到这样的问题: 由于系统中的按键在底层做了重新定义或者新增了按键,此时需要在APP层对按键事件(keyevent)做分解处理,模拟Android系统做法,把keyevent分解成: 1、单击事件:就是普通key的单击; 2、双击事件:500ms内同一按键单击两次; 3、长按事件:同一按键长按超过1000ms(系统中长按事件为500ms); 4、组合按键:两个以上按键同时按住; </div> </li> <li><a href="/article/3088.htm" title="asp.net获取站点根目录下子目录的名称" target="_blank">asp.net获取站点根目录下子目录的名称</a> <span class="text-muted">hvt</span> <a class="tag" taget="_blank" href="/search/.net/1.htm">.net</a><a class="tag" taget="_blank" href="/search/C%23/1.htm">C#</a><a class="tag" taget="_blank" href="/search/asp.net/1.htm">asp.net</a><a class="tag" taget="_blank" href="/search/hovertree/1.htm">hovertree</a><a class="tag" taget="_blank" href="/search/Web+Forms/1.htm">Web Forms</a> <div>使用Visual Studio建立一个.aspx文件(Web Forms),例如hovertree.aspx,在页面上加入一个ListBox代码如下: <asp:ListBox runat="server" ID="lbKeleyiFolder" />   那么在页面上显示根目录子文件夹的代码如下: string[] m_sub</div> </li> <li><a href="/article/3215.htm" title="Eclipse程序员要掌握的常用快捷键" target="_blank">Eclipse程序员要掌握的常用快捷键</a> <span class="text-muted">justjavac</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/eclipse/1.htm">eclipse</a><a class="tag" taget="_blank" href="/search/%E5%BF%AB%E6%8D%B7%E9%94%AE/1.htm">快捷键</a><a class="tag" taget="_blank" href="/search/ide/1.htm">ide</a> <div>  判断一个人的编程水平,就看他用键盘多,还是鼠标多。用键盘一是为了输入代码(当然了,也包括注释),再有就是熟练使用快捷键。   曾有人在豆瓣评 《卓有成效的程序员》:“人有多大懒,才有多大闲”。之前我整理了一个 程序员图书列表,目的也就是通过读书,让程序员变懒。  写道 程序员作为特殊的群体,有的人可以这么懒,懒到事情都交给机器去做,而有的人又可</div> </li> <li><a href="/article/3342.htm" title="c++编程随记" target="_blank">c++编程随记</a> <span class="text-muted">lx.asymmetric</span> <a class="tag" taget="_blank" href="/search/C%2B%2B/1.htm">C++</a><a class="tag" taget="_blank" href="/search/%E7%AC%94%E8%AE%B0/1.htm">笔记</a> <div> 为了字体更好看,改变了格式……   &&运算符:   #include<iostream> using namespace std; int main(){      int a=-1,b=4,k;      k=(++a<0)&&!(b--</div> </li> <li><a href="/article/3469.htm" title="linux标准IO缓冲机制研究" target="_blank">linux标准IO缓冲机制研究</a> <span class="text-muted">音频数据</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>一、什么是缓存I/O(Buffered I/O)缓存I/O又被称作标准I/O,大多数文件系统默认I/O操作都是缓存I/O。在Linux的缓存I/O机制中,操作系统会将I/O的数据缓存在文件系统的页缓存(page cache)中,也就是说,数据会先被拷贝到操作系统内核的缓冲区中,然后才会从操作系统内核的缓冲区拷贝到应用程序的地址空间。1.缓存I/O有以下优点:A.缓存I/O使用了操作系统内核缓冲区,</div> </li> <li><a href="/article/3596.htm" title="随想 生活" target="_blank">随想 生活</a> <span class="text-muted">暗黑小菠萝</span> <a class="tag" taget="_blank" href="/search/%E7%94%9F%E6%B4%BB/1.htm">生活</a> <div>其实账户之前就申请了,但是决定要自己更新一些东西看也是最近。从毕业到现在已经一年了。没有进步是假的,但是有多大的进步可能只有我自己知道。   毕业的时候班里12个女生,真正最后做到软件开发的只要两个包括我,PS:我不是说测试不好。当时因为考研完全放弃找工作,考研失败,我想这只是我的借口。那个时候才想到为什么大学的时候不能好好的学习技术,增强自己的实战能力,以至于后来找工作比较费劲。我</div> </li> <li><a href="/article/3723.htm" title="我认为POJO是一个错误的概念" target="_blank">我认为POJO是一个错误的概念</a> <span class="text-muted">windshome</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/POJO/1.htm">POJO</a><a class="tag" taget="_blank" href="/search/%E7%BC%96%E7%A8%8B/1.htm">编程</a><a class="tag" taget="_blank" href="/search/J2EE/1.htm">J2EE</a><a class="tag" taget="_blank" href="/search/%E8%AE%BE%E8%AE%A1/1.htm">设计</a> <div>              这篇内容其实没有经过太多的深思熟虑,只是个人一时的感觉。从个人风格上来讲,我倾向简单质朴的设计开发理念;从方法论上,我更加倾向自顶向下的设计;从做事情的目标上来看,我追求质量优先,更愿意使用较为保守和稳妥的理念和方法。    &</div> </li> </ul> </div> </div> </div> <div> <div class="container"> <div class="indexes"> <strong>按字母分类:</strong> <a href="/tags/A/1.htm" target="_blank">A</a><a href="/tags/B/1.htm" target="_blank">B</a><a href="/tags/C/1.htm" target="_blank">C</a><a href="/tags/D/1.htm" target="_blank">D</a><a href="/tags/E/1.htm" target="_blank">E</a><a href="/tags/F/1.htm" target="_blank">F</a><a href="/tags/G/1.htm" target="_blank">G</a><a href="/tags/H/1.htm" target="_blank">H</a><a href="/tags/I/1.htm" target="_blank">I</a><a href="/tags/J/1.htm" target="_blank">J</a><a href="/tags/K/1.htm" target="_blank">K</a><a href="/tags/L/1.htm" target="_blank">L</a><a href="/tags/M/1.htm" target="_blank">M</a><a href="/tags/N/1.htm" target="_blank">N</a><a href="/tags/O/1.htm" target="_blank">O</a><a href="/tags/P/1.htm" target="_blank">P</a><a href="/tags/Q/1.htm" target="_blank">Q</a><a href="/tags/R/1.htm" target="_blank">R</a><a href="/tags/S/1.htm" target="_blank">S</a><a href="/tags/T/1.htm" target="_blank">T</a><a href="/tags/U/1.htm" target="_blank">U</a><a href="/tags/V/1.htm" target="_blank">V</a><a href="/tags/W/1.htm" target="_blank">W</a><a href="/tags/X/1.htm" target="_blank">X</a><a href="/tags/Y/1.htm" target="_blank">Y</a><a href="/tags/Z/1.htm" target="_blank">Z</a><a href="/tags/0/1.htm" target="_blank">其他</a> </div> </div> </div> <footer id="footer" class="mb30 mt30"> <div class="container"> <div class="footBglm"> <a target="_blank" href="/">首页</a> - <a target="_blank" href="/custom/about.htm">关于我们</a> - <a target="_blank" href="/search/Java/1.htm">站内搜索</a> - <a target="_blank" href="/sitemap.txt">Sitemap</a> - <a target="_blank" href="/custom/delete.htm">侵权投诉</a> </div> <div class="copyright">版权所有 IT知识库 CopyRight © 2000-2050 E-COM-NET.COM , All Rights Reserved. <!-- <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">京ICP备09083238号</a><br>--> </div> </div> </footer> <!-- 代码高亮 --> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shCore.js"></script> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shLegacy.js"></script> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shAutoloader.js"></script> <link type="text/css" rel="stylesheet" href="/static/syntaxhighlighter/styles/shCoreDefault.css"/> <script type="text/javascript" src="/static/syntaxhighlighter/src/my_start_1.js"></script> </body> </html>