按键写入表格的应用(保留seo查关键词的排名)
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">本期<span style="color: black;">文案</span>讲两个知识点,一是把数据写入表格。</span><span style="color: black;">二是<span style="color: black;">经过</span>api数据接口获取关键词在百度上的排名<span style="color: black;">状况</span>。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">先<span style="color: black;">来讲</span><span style="color: black;">怎样</span>把数据写入表格<span style="color: black;">其中</span>,用过采集软件的<span style="color: black;">伴侣</span>,可能接触过这么一种文件格式(.csv),这个格式在百度百科里面描述的名字叫“逗号分隔值”,<span style="color: black;">然则</span>从文件图标上来看,和excel表格是<span style="color: black;">同样</span>的,<span style="color: black;">亦</span><span style="color: black;">便是</span>说它<span style="color: black;">亦</span>是支持office办公软件打开的。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/7QyvJQqbWwL4Y0fmVIt61g02sLcHzzibpjdJsAXEv89zicFTf0TfNRrrMYzoK6vI274GhBeXLR2ZPR0oicqjlhaibQ/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">经过</span>它名字“逗号分隔值”,<span style="color: black;">咱们</span>其实可能猜测到,它是<span style="color: black;">能够</span><span style="color: black;">经过</span>逗号进行分隔的,这个<span style="color: black;">亦</span>是它的最大特点。</span><span style="color: black;"><span style="color: black;">详细</span><span style="color: black;">来讲</span><span style="color: black;">便是</span>当写入的内容中,有英文状态下的的逗号,就会以逗号<span style="color: black;">掰开</span>,放入表格中的<span style="color: black;">区别</span>“列”中。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">例如</span>写入的内容是qwe,sdf</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">看到的效果<span style="color: black;">便是</span>下面<span style="color: black;">这般</span>~</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/7QyvJQqbWwL4Y0fmVIt61g02sLcHzzibp2UDhdbjBKNOVk5qWlTMm6xmjuwicVf7TWMgLtTpbZaXcW44LgDbLtRQ/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">当然,这个csv文件<span style="color: black;">倘若</span>用记事本打开,还是<span style="color: black;">表示</span>qwe,sdf</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/7QyvJQqbWwL4Y0fmVIt61g02sLcHzzibpY23rPmTRgPEpeFibc41x4Tj35XafNwtEwvaNrMLYuR4ReTV4xarEuog/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">它的用处是啥呢?</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">对比上面两张图,记事本<span style="color: black;">表示</span>的是一行内容,而csv<span style="color: black;">经过</span>表格工具打开以后是<span style="color: black;">表示</span>一行两列。</span><span style="color: black;"><span style="color: black;">这般</span><span style="color: black;">倘若</span>多类数据写入的话,就<span style="color: black;">能够</span>实现分列展示。</span><span style="color: black;">后期需要数据运算处理,直接转化成表格的xls格式,非常方便。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">第二个知识点,<span style="color: black;">经过</span>api接口获取关键词在百度搜索中的排名<span style="color: black;">状况</span>。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这里用的是站长工具的api数据接口,http://api.chinaz.com/ApiDetails/BaiduPcRanking</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这个接口<span style="color: black;">每日</span>有500个的免费<span style="color: black;">查找</span>量,<span style="color: black;">针对</span>普通的网站的SEO<span style="color: black;">查找</span>是足够了。</span><span style="color: black;"><span style="color: black;">针对</span>做网站优化,网络推广的<span style="color: black;">伴侣</span>还有有<span style="color: black;">有些</span>用处的。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">先<span style="color: black;">瞧瞧</span>它的API文档:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/7QyvJQqbWwInibSkicQLnw57nia7NibVw40gIbaes7SLvsyhgHRJalMt3xmkEE33PsQicIZsViaYm6mJ2RV3037sTiaicw/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">针对</span>api对接,<span style="color: black;">平常</span>的<span style="color: black;">便是</span>get和post两种方式,本期的案例中两种都支持,<span style="color: black;">那样</span><span style="color: black;">针对</span>都支持的<span style="color: black;">咱们</span>就用相对简单的get方式。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">下面<span style="color: black;">咱们</span><span style="color: black;">起始</span><span style="color: black;">详细</span>的操作,</span><span style="color: black;">新建一个csv文件,和新建txt<span style="color: black;">同样</span>,直接用file.write命令。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Dim 路径="/sdcard/pictures/排名.csv"</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">file.Write (路径, "")</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">生成好csv以后,接下来是要对接api接口了,先去申请一个key,这个需要注册,<span style="color: black;">这儿</span><span style="color: black;">倘若</span>你仅仅为了测试,直接用我的:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">"c40fa0ee91ea4e2f8fbf303470806194"</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">每日</span>500的免费量,很可能用的人多,一会儿就<span style="color: black;">无</span>了。</span><span style="color: black;"><span style="color: black;">这儿</span><span style="color: black;">意见</span><span style="color: black;">大众</span>自己申请,<span style="color: black;">倘若</span>测试<span style="color: black;">没法</span><span style="color: black;">运用</span>,可能<span style="color: black;">便是</span>这个<span style="color: black;">原由</span>了。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">咱们</span>以在百度上搜索“按键精灵安卓版教程”这个关键词为例,<span style="color: black;">瞧瞧</span>我在简书上发<span style="color: black;">文案</span>的页面的排名<span style="color: black;">状况</span>。</span><span style="color: black;">为了能够有数据,<span style="color: black;">这儿</span>我刻意找了一个有排名的页面来做案例。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Dim 路径="/sdcard/pictures/排名.csv"</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Dim 路径1="/sdcard/pictures/未有排名.csv"</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">file.Write <span style="color: black;">(路径, "")</span></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">file.Write (路径1, "")</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Import "shanhai.lua"</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Dim key="c40fa0ee91ea4e2f8fbf303470806194"</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Dim 域名="www.jianshu.com"</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Dim 关键词="按键精灵安卓版教程"</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Dim m=ShanHai.GetHttp("http://apidata.chinaz.com/CallAPI/BaiduPcRanking?key="&key&"&domainName="&域名&"&keyword="&关键词)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">TracePrint m</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Dim a=Encode.JsonToTable(m)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">If a["Reason"] = "成功" Then</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> If UBOUND(a["Result"]["Ranks"]) > -1 Then </span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> If InStr(1, a["Result"]["Ranks"]["RankStr"], "1-")>0 Then </span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Dim x=split(a["Result"]["Ranks"]["RankStr"],"-")</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> Dim y=a["Result"]["Ranks"]["Title"]</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> TracePrint 关键词&"----"&y&"----"&"首页第"&x(1)&"位"</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> File.writeline(路径,1,关键词&","&y&","&"首页第"&x(1)&"位")</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> End If</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Else</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> File.writeline(路径1,1,关键词)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> End If</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">End If</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">有排名就<span style="color: black;">能够</span>看到如下效果:关键词+网站标题+百度排名<span style="color: black;">状况</span></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/7QyvJQqbWwInibSkicQLnw57nia7NibVw40ghaG2wanP1hUloMe8k0tXibUnNNRjrnxdDf5qLOCy7yYLC4OztvhdTSA/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">当然<span style="color: black;">这儿</span>我还用<span style="color: black;">另一</span>一个csv文件,存储<span style="color: black;">无</span>排名的关键词,留做备份之后着重优化的词语。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">因为</span>之前有多期教程讲过api对接以及返回值为json的提取方式,<span style="color: black;">这儿</span>就不重新写了。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">需要有几点<span style="color: black;">重视</span>的<span style="color: black;">地区</span>:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">1、</span>我在测试时候,url.get命令当网址是拼接的时候,获取不到数据,<span style="color: black;">因此</span><span style="color: black;">选择</span>了<span style="color: black;">一样</span>功能的山海命令。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">2、</span>这个案例中我只写了一个关键词的测试,<span style="color: black;">倘若</span>是多个关键词的,<span style="color: black;">能够</span>循环获取。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">3、</span><span style="color: black;">运用</span>脚本时,<span style="color: black;">不可</span>打开csv,否则<span style="color: black;">没法</span>写入数据到csv中,<span style="color: black;">引起</span>脚本报错。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">4、</span>这个api数据接口支持批量获取数据,<span style="color: black;">自动</span><span style="color: black;">科研</span>下吧。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">好了,本期内容就这些,</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">倘若</span>觉得<span style="color: black;">文案</span>还不错,麻烦点一下右下角的“在看”,谢谢!</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">其他<span style="color: black;">文案</span><span style="color: black;">举荐</span>:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><a style="color: black;">让界面上<span style="color: black;">显现</span>你想要的文字</a></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><a style="color: black;">关于按键ui界面上的数据重启丢失的<span style="color: black;">原由</span></a></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><a style="color: black;">【补发】自动答题脚本教程及源码分享(无视分辨率)</a></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><a style="color: black;">“价值200元”的脚本该怎么去写?(多重判断脚本案例)</a></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;">做一个能自动聊天的脚本</span></a>(源码分享)</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;">提取api返回值里面的内容</span></a></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><a style="color: black;">百度云文字识别源码分享</a></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><a style="color: black;">让脚本<span style="color: black;">拥有</span>“记忆”功能</a></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;"><span style="color: black;">怎样</span>能够对接联众打码平台</span></a></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;">关于按键精灵安卓版“文本”<span style="color: black;">关联</span>问的最多的新手问题</span></a></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;">提取你想要的内容(正则匹配的简单介绍)</span></a></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">你好,欢迎关注3分钟学堂公众号~</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">3分钟学堂VIP群:78237147 (付费QQ群)</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">已然</span>开通付费入群模式,自动扣费无需联系群主,群费48.8元</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">付费群内有高清视频教程下载,还有<span style="color: black;">有些</span>教程源码</p>群主解答按键精灵安卓版<span style="color: black;">关联</span>问题
<span style="color: black;">【<span style="color: black;">处理</span>问问题没人解答的苦恼】</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">我的<span style="color: black;">微X</span>:xiaomu86119</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">我的QQ:453485278</p>3分钟学堂②群:
<span style="color: black;">375173022 (已满)</span><span style="color: black;">3分钟学堂③群:</span><span style="color: black;">128690361 (已满)</span><span style="color: black;">3分钟学堂④群:</span><span style="color: black;">780851761 (已满)</span><span style="color: black;">3分钟学堂⑤群:</span><span style="color: black;">581913551 (已满)</span><span style="color: black;">3分钟学堂⑥群:</span><span style="color: black;">777894623 (已满)</span><span style="color: black;">3分钟学堂⑦群:</span><span style="color: black;">922677093 (已满)</span><span style="color: black;">3分钟学堂⑧群:</span><span style="color: black;">929476763 (已满)</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">3分钟学堂⑨群:113086396 <span style="color: black;">(</span>已满<span style="color: black;">)</span></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">3分钟学堂⑩群:686963885 (新群)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">另一</span><span style="color: black;">能够</span>点击下方的按钮,查看往期<span style="color: black;">文案</span>。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">直接回复“教程”,获取下载<span style="color: black;">位置</span></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><img src="https://mmbiz.qpic.cn/mmbiz_jpg/7QyvJQqbWwJ8dByZxIWm0aZ8m3JoSK90lwoXuzB1ibMdia7dbjyNZpBKGW8aa9oMUlCLic6WSbvPcibgZ64gr2iaqhA/640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" style="width: 50%; margin-bottom: 20px;"></span></p>
感谢你的精彩评论,带给我新的思考角度。 期待更新、坐等、迫不及待等。 你说得对,我们一起加油,未来可期。 说得好啊!我在外链论坛打滚这么多年,所谓阅人无数,就算没有见过猪走路,也总明白猪肉是啥味道的。 期待楼主的下一次分享!” 百度seo优化论坛 http://www.fok120.com/
页:
[1]