规则做对了,在爬数据的时候,发现有些数据抓到了,有些数据没有抓到
链接地址  http://www.atobo.com.cn/Companys/s-p17-s406-c1-k3352-y4/


数据规则<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:svg="http://www.w3.org/2000/svg" >
<xsl:template match="/">
<标题>
<xsl:apply-templates select="//*[@class='product_contextlist bplist']/ul/li[position()>=1 and count(.//*[@class='CompanyName'])>0 and count(.//*[@class='pp_product'])>0 and count(.//*[@class='c_name']/strong/text())>0 and count(.//*[@class='pp_2web']/strong/a[position()=1]/@href)>0]" mode="标题"/>
</标题>
</xsl:template>




<xsl:template match="//*[@class='product_contextlist bplist']/ul/li[position()>=1 and count(.//*[@class='CompanyName'])>0 and count(.//*[@class='pp_product'])>0 and count(.//*[@class='c_name']/strong/text())>0 and count(.//*[@class='pp_2web']/strong/a[position()=1]/@href)>0]" mode="标题">
<item>
<公司名称>
<xsl:value-of select="*//*[@class='CompanyName']"/>
<xsl:value-of select="*[@class='CompanyName']"/>
</公司名称>
<主营>
<xsl:value-of select="*//*[@class='pp_product']"/>
<xsl:value-of select="*[@class='pp_product']"/>
</主营>
<地址>
<xsl:value-of select="*//*[@class='pp_address']/strong/text()"/>
<xsl:value-of select="*[@class='pp_address']/strong/text()"/>
<xsl:if test="@class='pp_address'">
<xsl:value-of select="strong/text()"/>
</xsl:if>
</地址>
<联系人>
<xsl:value-of select="*//*[@class='c_name']/strong/text()"/>
<xsl:value-of select="*[@class='c_name']/strong/text()"/>
<xsl:if test="@class='c_name'">
<xsl:value-of select="strong/text()"/>
</xsl:if>
</联系人>
<网址>
<xsl:value-of select="*//*[@class='pp_2web']/strong/a[position()=1]/@href"/>
<xsl:value-of select="*[@class='pp_2web']/strong/a[position()=1]/@href"/>
<xsl:if test="@class='pp_2web'">
<xsl:value-of select="strong/a[position()=1]/@href"/>
</xsl:if>
</网址>
</item>
</xsl:template>
</xsl:stylesheet>


输出信息:<?xml version="1.0" encoding="UTF-8"?>


<标题>
        <item>
                <公司名称>南京钢加工程机械实业有限公司溧阳分公司</公司名称>
                <主营>主营:普通机械及配件,汽车(不含小轿车)及配件,电器机械及器材,日用杂品,建筑工程机械租凭</主营>
                <地址>台港新村公建6-11轴</地址>
                <联系人>段立中 业务经理</联系人>
                <网址>http://09s9476535.atobo.com.cn</网址>
        </item>
只显示5个输出漏抓了15个
file:///C:\Users\steven\AppData\Roaming\Tencent\Users\1192599412\QQ\WinTemp\RichOle\R%GXL3V}8_Z70VHI)X)M3CG.png


举报 使用道具
| 回复

共 24 个关于本帖的回复 最后回复于 2017-3-21 21:46

沙发
cwg1002 初级会员 发表于 2017-3-20 15:15:01 | 只看该作者
求回复
举报 使用道具
板凳
quyixuan 金牌会员 发表于 2017-3-20 15:25:20 | 只看该作者

你把主题名贴出来吧

举报 使用道具
地板
cwg1002 初级会员 发表于 2017-3-20 15:32:32 | 只看该作者
这是主题名

)KSE`9O77`8VMRBTX@6A5W9.png (104.82 KB, 下载次数: 570)

)KSE`9O77`8VMRBTX@6A5W9.png
举报 使用道具
5#
cwg1002 初级会员 发表于 2017-3-20 15:35:45 | 只看该作者
第二级是阿土伯气2级
举报 使用道具
6#
cwg1002 初级会员 发表于 2017-3-20 15:37:29 | 只看该作者
还有之前比较好的“阿士伯”
第二级是 阿士伯第2级
举报 使用道具
7#
cwg1002 初级会员 发表于 2017-3-20 15:37:50 | 只看该作者
本帖最后由 cwg1002 于 2017-3-20 15:48 编辑

数据爬不全,求大神支招
举报 使用道具
8#
quyixuan 金牌会员 发表于 2017-3-20 16:01:08 | 只看该作者
cwg1002 发表于 2017-3-20 15:37
数据爬不全,求大神支招

你把所有的采集字段全都勾上了关键内容,这是漏抓的原因,只需要一个字段勾选关键内容就可以,我试了只有“公司名称”勾选关键内容,可以采集全

举报 使用道具
9#
cwg1002 初级会员 发表于 2017-3-20 16:19:33 | 只看该作者
本帖最后由 cwg1002 于 2017-3-20 16:22 编辑

你用的是哪个,还有为和不能都勾选?如何打赏评论?
举报 使用道具
10#
cwg1002 初级会员 发表于 2017-3-20 16:20:22 | 只看该作者
quyixuan 发表于 2017-3-20 16:01
你把所有的采集字段全都勾上了关键内容,这是漏抓的原因,只需要一个字段勾选关键内容就可以,我试了只有 ...

你用的是哪个?“阿士伯”还是“阿土伯气”?我用“阿士伯”只勾选一个关键   还是抓取不全
举报 使用道具
您需要登录后才可以回帖 登录 | 立即注册

精彩推荐

  • Gephi社会网络分析-马蜂窝游记文本分词并同
  • Gephi社会网络分析-基于马蜂窝游记文本以词
  • 知乎话题文本根据词语间距筛选后生成共词矩
  • 马蜂窝游记文本分词后以词语间距为筛选条件
  • 学习使用apriori算法挖掘关联关系

热门用户

GMT+8, 2024-5-2 14:20