网站抓取:
1.百度 关键字抓取(如 北京 公司,北京 企业)
2.百度 企业名称抓取(公司名称)
初步抓取的都是通过百度,采集到的title和bd_url(并不是网站的url,是指百度跳转的url)
抓第一页就好,不必抓取第二页
3.去掉死链接,去掉黄页等非网站数据,
bd_name like '%主页%' or
bd_name like '%官网%' or
bd_name like '%官方网站%'or
bd_name like '%集团%'or
bd_name like '%首页%'
筛选出 title 包含这写关键词的数据,相对准确一些,不然数量太大
4.根据抓下来数据的bd_url,采集网站内的web_url,web_title,web_context,保存
5.去重复,根据web_url和web_title去掉黄页
6.从web_context中获取 公司名称、联系电话、地址、ICP信息,通过地址和ICP确定网站是属于哪一个区域的网站, 没有ICP备案号的网站可能就存在问题,有待研究
-----------------从网页内容中获取ICP和地址等信息的有关sql(网站内容中截取出相关信息,最好是文本,不要存html)
[color=red]1.ICP[/color]
update table tt set tt.ent_icp=substr(tt.web_text,instr(tt.web_text,'京ICP',1)-1,30)
where tt.web_text like '%京ICP%'
update table tt set tt.ent_icp=substr(tt.web_text,instr(tt.web_text,'ICP',1)-1,30)
where tt.web_text like '%ICP%' and tt.ent_icp is null
[color=red]2.地址[/color]
update table tt set tt.ent_address=substr(tt.web_text,instr(tt.web_text,'地址',1),50)
where tt.web_text like '%地址%'
[color=red]3.电话[/color]
update table tt set tt.tellphone=substr(tt.web_text,instr(tt.web_text,'电话',1),20)
where tt.web_text like '%电话%'
update table tt set tt.tellphone=substr(tt.web_text,instr(tt.web_text,'热线',1),20)
where tt.web_text like '%热线%' and tt.tellphone is null
[color=red]4.公司名称[/color]
update table tt set tt.ent_name=substr(tt.web_text,instr(tt.web_text,'版权所有',1)-30,30)
where tt.web_text like '%版权所有%'
1.百度 关键字抓取(如 北京 公司,北京 企业)
2.百度 企业名称抓取(公司名称)
初步抓取的都是通过百度,采集到的title和bd_url(并不是网站的url,是指百度跳转的url)
抓第一页就好,不必抓取第二页
3.去掉死链接,去掉黄页等非网站数据,
bd_name like '%主页%' or
bd_name like '%官网%' or
bd_name like '%官方网站%'or
bd_name like '%集团%'or
bd_name like '%首页%'
筛选出 title 包含这写关键词的数据,相对准确一些,不然数量太大
4.根据抓下来数据的bd_url,采集网站内的web_url,web_title,web_context,保存
5.去重复,根据web_url和web_title去掉黄页
6.从web_context中获取 公司名称、联系电话、地址、ICP信息,通过地址和ICP确定网站是属于哪一个区域的网站, 没有ICP备案号的网站可能就存在问题,有待研究
-----------------从网页内容中获取ICP和地址等信息的有关sql(网站内容中截取出相关信息,最好是文本,不要存html)
[color=red]1.ICP[/color]
update table tt set tt.ent_icp=substr(tt.web_text,instr(tt.web_text,'京ICP',1)-1,30)
where tt.web_text like '%京ICP%'
update table tt set tt.ent_icp=substr(tt.web_text,instr(tt.web_text,'ICP',1)-1,30)
where tt.web_text like '%ICP%' and tt.ent_icp is null
[color=red]2.地址[/color]
update table tt set tt.ent_address=substr(tt.web_text,instr(tt.web_text,'地址',1),50)
where tt.web_text like '%地址%'
[color=red]3.电话[/color]
update table tt set tt.tellphone=substr(tt.web_text,instr(tt.web_text,'电话',1),20)
where tt.web_text like '%电话%'
update table tt set tt.tellphone=substr(tt.web_text,instr(tt.web_text,'热线',1),20)
where tt.web_text like '%热线%' and tt.tellphone is null
[color=red]4.公司名称[/color]
update table tt set tt.ent_name=substr(tt.web_text,instr(tt.web_text,'版权所有',1)-30,30)
where tt.web_text like '%版权所有%'