Python爬虫的法律边界(一)爬虫有风险,开爬要谨慎!

来交代一下,你抓了多少数据,在哪抓的,干什么用了,看够在里面待几年。

从去年开始我看到好几起因为抓取数据而遭遇诉讼,有的锒铛入狱,有的被处罚金,从案件的模糊描述来看,我看得后背发凉,似乎每个爬虫选手都有被KO的风险。

这几个月也停止了几个抓取工作,把有关的法律和新闻认真看了几遍,写了如下文章。

<tt-image data-tteditor-tag=”tteditorTag” contenteditable=”false” class=”syl1556606890908″ data-render-status=”finished” data-syl-blot=”image” style=”box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: “PingFang SC”, “Hiragino Sans GB”, “Microsoft YaHei”, “WenQuanYi Micro Hei”, “Helvetica Neue”, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;”>
《Python爬虫的法律边界(一)爬虫有风险,开爬要谨慎!》 image

<input class=”pgc-img-caption-ipt” placeholder=”图片描述(最多50字)” value=”” style=”box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;”></tt-image>

Python学习交流群:1004391443,有大牛答疑,有资源共享!有想学习python编程的,想提升自己能力的,欢迎加入讨论学习。

PS:这里讨论的是网络爬虫技术本身,爬虫技术的手法可以用来抓群数据,还可以做其它事情,比如登录社交账号自动发帖,比如刷搜索排名等等。

《刑法》对网络爬虫的定罪依据

《刑法》第 285 条,非法获取计算机信息系统数据罪。

获取该计算机信息系统中存储、处理或者传输的数据,或者对该计算机信息系统实施非法控制,

处三年以下有期徒刑或者拘役,并处或者单处罚金; 最高处七年有期徒刑并处罚金。

《刑法》第285条是对爬取数据的主要定罪依据,有兴趣可以去查下中华人民共和国刑法。

定罪的几个案例:

从已有案例来看有以下几种情况:

1.数据拥有者有证据能够举证你的数据是抓取来的。如下,今日头条对起诉上海晟品法院宣判结果。

<tt-image data-tteditor-tag=”tteditorTag” contenteditable=”false” class=”syl1556606890912″ data-render-status=”finished” data-syl-blot=”image” style=”box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: “PingFang SC”, “Hiragino Sans GB”, “Microsoft YaHei”, “WenQuanYi Micro Hei”, “Helvetica Neue”, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;”>
《Python爬虫的法律边界(一)爬虫有风险,开爬要谨慎!》 image

<input class=”pgc-img-caption-ipt” placeholder=”图片描述(最多50字)” value=”” style=”box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;”></tt-image>

法院文书

<tt-image data-tteditor-tag=”tteditorTag” contenteditable=”false” class=”syl1556606890915″ data-render-status=”finished” data-syl-blot=”image” style=”box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: “PingFang SC”, “Hiragino Sans GB”, “Microsoft YaHei”, “WenQuanYi Micro Hei”, “Helvetica Neue”, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;”>
《Python爬虫的法律边界(一)爬虫有风险,开爬要谨慎!》 image

<input class=”pgc-img-caption-ipt” placeholder=”图片描述(最多50字)” value=”” style=”box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;”></tt-image>

法院文书判决结果

图片文字来自中国判决文书网。

从文书描述来看,修改UA,修改device id,绕开网站访问频率控制这是写爬虫的基本,这些手法反而成为了获罪的依据。

2.用户社交数据,尤其是用户隐私相关。

<tt-image data-tteditor-tag=”tteditorTag” contenteditable=”false” class=”syl1556606890918″ data-render-status=”finished” data-syl-blot=”image” style=”box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: “PingFang SC”, “Hiragino Sans GB”, “Microsoft YaHei”, “WenQuanYi Micro Hei”, “Helvetica Neue”, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;”>
《Python爬虫的法律边界(一)爬虫有风险,开爬要谨慎!》 image

<input class=”pgc-img-caption-ipt” placeholder=”图片描述(最多50字)” value=”” style=”box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;”></tt-image>

微博脉脉判决文书

<tt-image data-tteditor-tag=”tteditorTag” contenteditable=”false” class=”syl1556606890921″ data-render-status=”finished” data-syl-blot=”image” style=”box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: “PingFang SC”, “Hiragino Sans GB”, “Microsoft YaHei”, “WenQuanYi Micro Hei”, “Helvetica Neue”, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;”>
《Python爬虫的法律边界(一)爬虫有风险,开爬要谨慎!》 image

<input class=”pgc-img-caption-ipt” placeholder=”图片描述(最多50字)” value=”” style=”box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;”></tt-image>

微博脉脉判决文书结果

图片文字来自新浪网

3.扰乱对方网站经营规则,且牟利。比如这个:

<tt-image data-tteditor-tag=”tteditorTag” contenteditable=”false” class=”syl1556606890924″ data-render-status=”finished” data-syl-blot=”image” style=”box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: “PingFang SC”, “Hiragino Sans GB”, “Microsoft YaHei”, “WenQuanYi Micro Hei”, “Helvetica Neue”, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;”>
《Python爬虫的法律边界(一)爬虫有风险,开爬要谨慎!》 image

<input class=”pgc-img-caption-ipt” placeholder=”图片描述(最多50字)” value=”” style=”box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;”></tt-image>

爬虫刷搜索排名判决文书

<tt-image data-tteditor-tag=”tteditorTag” contenteditable=”false” class=”syl1556606890928″ data-render-status=”finished” data-syl-blot=”image” style=”box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: “PingFang SC”, “Hiragino Sans GB”, “Microsoft YaHei”, “WenQuanYi Micro Hei”, “Helvetica Neue”, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;”>
《Python爬虫的法律边界(一)爬虫有风险,开爬要谨慎!》 image

<input class=”pgc-img-caption-ipt” placeholder=”图片描述(最多50字)” value=”” style=”box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;”></tt-image>

爬虫刷搜索排名判决结果

图片文字来自中国永嘉公号

图上描述做搜索引擎排名的技术,其实就是利用爬虫技术规模化的访问网页。

在我们通常的认知里,因为互联网推崇分享精神,所以认为只要是网络公开数据就可以抓取,但是通过上面的案例来看,

有几个禁忌,抓取的数据最好不要直接商用,涉及社交信息/用户信息要谨慎, 老板交代你抓取敏感任务时,让老板先看下刑法第285条。

这不代表个人行为就没事,只是还没入他们的法眼。

在数据抓取这方面,美国也有一个判决案例,美国一家小公司向法院起诉Linkedin,理由是Linkedin通过技术手段阻止他抓取Linkedin上的数据,

而且法院判定这家公司胜诉,裁定Linkedin不准屏蔽这家公司的抓取行为。

目前我国法律是偏向数据拥有者的,如果数据拥有着者有证据向法院起诉的话,抓取数据的一方多半会败诉。

另外在抓取过程中,如果破解/反编译对方客户端、软件,破解加密算法,

比如你抓某APP数据,去反编译他的客户端,这绝对是犯法,这是破坏计算机信息系统罪。

爬虫有风险,开爬要谨慎。

如果你依然在编程的世界里迷茫,不知道自己的未来规划,可以加入我们的Python学习扣qun:784758214,看看前辈们是如何学习的!交流经验!

自己是一名高级python开发工程师,从基础的python脚本到web开发、爬虫、django、人工智能、数据挖掘等,零基础到项目实战的资料都有整理。

送给每一位python的小伙伴!分享一些学习的方法和需要注意的小细节,这里是python学习者聚集地

    原文作者:不谈风月_0eb8
    原文地址: https://www.jianshu.com/p/4676427fdfc8
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞