真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

怎么在PHP命令行模式中采集股票趨勢信息-創(chuàng)新互聯(lián)

怎么在PHP命令行模式中采集股票趨勢信息?針對這個(gè)問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問題的小伙伴找到更簡單易行的方法。

成都創(chuàng)新互聯(lián)公司主營碌曲網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,成都app開發(fā),碌曲h5微信小程序開發(fā)搭建,碌曲網(wǎng)站營銷推廣歡迎碌曲等地區(qū)企業(yè)咨詢

主要函數(shù)只有一個(gè)類實(shí)現(xiàn)(stock.class.php):


 stockId = $stockId;
 }
 
 private function getUrl(){
  return "http://stockpage.10jqka.com.cn/" . $this -> stockId . "/";
 }
 
 private function getPage(){
  return file_get_contents($this -> getUrl());
 }
 
 //核心,通過正則匹配出 標(biāo)簽名,并將對應(yīng)的方法的結(jié)果替換掉標(biāo)簽占位符
 public function getInfo($template){
  $html = $this -> getPage();
  if( preg_match_all("/\{([^\}]*)\}/", $template, $result) ){
  foreach($result[1] as $index => $fun){
   $template = str_replace($result[0][$index], $this -> $fun($html), $template);
  }
  }
  return mb_convert_encoding($template, "GBK", "UTF-8"); //Windows的命令提示符編碼是GBK
 }
 
 private function match($pattern, $html, $itemIndex = 1){
  $pattern = '/' . str_replace('/', '\/', $pattern) . '/';
  if( preg_match($pattern, $html, $result) ){
  return $result[$itemIndex];
  }else{
  return "-";
  }
 }
 
 //趨勢的規(guī)則都一樣,合并
 private function qushiPattern($name){
  return '' . $name . ':
\s*([^<]*)
';  }    //支持的標(biāo)簽  private function name($html){   return $this -> match("([^\(<]*)\(", $html, 1);  }  private function score($html){   return $this -> match('<span class="analyze-num">(\d+(\.\d+)?)</span>', $html);  }  private function tips($html){   return $this -> match('<span class="analyze-tips">([^<]*)</span>', $html);  }  private function qushishort($html){   return $this -> match($this -> qushiPattern("短期趨勢"), $html);  }  private function qushimiddle($html){   return $this -> match($this -> qushiPattern("中期趨勢"), $html);  }  private function qushilong($html){   return $this -> match($this -> qushiPattern("長期趨勢"), $html);  }  } ?></pre><p><strong>命令提示符中的調(diào)用方法如下(stock.php):</strong></p><pre><?php    if(count($argv) >= 2){  require("stock.class.php");  $stockId = $argv[1];  $stock = new StockClass($stockId);  $temp = $stockId;  $temp .= " {name}"; //名稱  $temp .= " {score}"; //評分  $temp .= " {tips}"; //描述  $temp .= " {qushishort}"; //短期趨勢  $temp .= " {qushimiddle}"; //中期趨勢  $temp .= " {qushilong}"; //長期趨勢  //$temp .= " {zidingyi}"; //自定義,直接在StockClass增加zidingyi方法即可  $temp .= "\n";  echo $stock -> getInfo($temp);  } ?></pre><p>直接使用<code> *\php.exe stock.php</code>股票代碼即可實(shí)現(xiàn)調(diào)用,每次輸入太長的,可以用批處理簡化。</p><p>將下面的代碼保存為 stock.cmd。</p><pre>@XXX\php.exe stock.php %1</pre><p><strong>運(yùn)行結(jié)果:</strong></p><p><strong><img src="/upload/otherpic24/40098.png" alt="怎么在PHP命令行模式中采集股票趨勢信息"></strong></p><p>這樣就完成了單個(gè)股票趨勢的采集,如果要采集所有的股票信息,可以保存為批處理文件(batch.cmd)</p><pre>@echo off call stock 000001 call stock 000002 call stock 000003 call stock 000004 call stock 000005 call stock 000006 call stock 000007 call stock 股票代碼n...</pre><p>雙擊打開即可顯示,如果想保存到文件,可以執(zhí)行<code>batch.cmd > log.txt</code>,然后將結(jié)果復(fù)制到 Execl(或ET)即可進(jìn)行更負(fù)責(zé)的分析。</p><p><img src="/upload/otherpic24/40099.png" alt="怎么在PHP命令行模式中采集股票趨勢信息"></p><p>關(guān)于怎么在PHP命令行模式中采集股票趨勢信息問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識。</p> <br> 當(dāng)前題目:怎么在PHP命令行模式中采集股票趨勢信息-創(chuàng)新互聯(lián) <br> 標(biāo)題鏈接:<a href="http://weahome.cn/article/pppdp.html">http://weahome.cn/article/pppdp.html</a> </div> </div> </div> <div id="squ6kqw" class="other container"> <h3>其他資訊</h3> <ul> <li> <a href="/article/ddghdsi.html">c語言命令行中定義函數(shù) 在c語言中定義函數(shù)</a> </li><li> <a href="/article/ddghdge.html">關(guān)于智能聊天爆火后的冷思考的信息</a> </li><li> <a href="/article/ddghdeh.html">阿里云服務(wù)器免費(fèi)服務(wù) 阿里云 免費(fèi)服務(wù)器</a> </li><li> <a href="/article/ddghdii.html">飛機(jī)論壇域名怎么取消綁定 飛機(jī)論壇域名怎么取消綁定賬號</a> </li><li> <a href="/article/ddghdee.html">買域名怎么綁定到服務(wù)器 買了域名和服務(wù)器怎么搭建網(wǎng)站</a> </li> </ul> </div> <div id="squ6kqw" class="footer"> <div id="squ6kqw" class="foota container"> <div id="squ6kqw" class="foot_nav fl col-lg-8 col-md-8 col-sm-12 col-xs-12"> <ul> <li id="squ6kqw" class="col-lg-3 col-md-3 col-sm-3 col-xs-6"> <h3>網(wǎng)站制作</h3> <a target="_blank">成都網(wǎng)站制作</a><a href="http://weahome.cn/zhizuo/" target="_blank">重慶網(wǎng)站制作</a><a target="_blank">手機(jī)網(wǎng)站制作</a><a target="_blank">網(wǎng)站制作</a><a target="_blank">達(dá)州網(wǎng)站制作</a><a target="_blank">H5網(wǎng)站制作</a> </li> <li id="squ6kqw" class="col-lg-3 col-md-3 col-sm-3 col-xs-6"> <h3>企業(yè)服務(wù)</h3> <a target="_blank">互聯(lián)網(wǎng)信息經(jīng)營許可證</a><a target="_blank">軟文發(fā)布</a><a target="_blank">互聯(lián)網(wǎng)藥品信息服務(wù)資格證</a><a target="_blank">軟文營銷</a><a target="_blank">網(wǎng)站備案</a><a target="_blank">免費(fèi)收錄</a> </li> <li id="squ6kqw" class="col-lg-3 col-md-3 col-sm-3 col-xs-6"> <h3>網(wǎng)站建設(shè)</h3> <a target="_blank">江油網(wǎng)站建設(shè)</a><a target="_blank">營銷網(wǎng)站建設(shè)</a><a target="_blank">成都網(wǎng)站建設(shè)</a><a target="_blank">成都品牌網(wǎng)站建設(shè)</a><a target="_blank">專業(yè)網(wǎng)站建設(shè)</a><a target="_blank">外貿(mào)網(wǎng)站建設(shè)</a> </li> <li id="squ6kqw" class="col-lg-3 col-md-3 col-sm-3 col-xs-6"> <h3>服務(wù)器托管</h3> <a target="_blank">綿陽服務(wù)器托管</a><a target="_blank">綿陽機(jī)房租用</a><a target="_blank">眉山服務(wù)器托管</a><a target="_blank">服務(wù)器托管機(jī)房</a><a target="_blank">資陽天府云計(jì)算中心</a><a target="_blank">成都西云機(jī)房</a> </li> </ul> </div> <div id="squ6kqw" class="footar fl col-lg-4 col-md-4 col-sm-12 col-xs-12"> <p>全國免費(fèi)咨詢:</p> <b>400-028-6601</b> <p>業(yè)務(wù)咨詢:028-86922220 / 13518219792</p> <p>節(jié)假值班:18980820575 / 13518219792</p> <p>聯(lián)系地址:成都市太升南路288號錦天國際A幢1002號</p> </div> </div> <div id="squ6kqw" class="footb"> <div id="squ6kqw" class="copy container"> <div id="squ6kqw" class="fl">Copyright ? 成都創(chuàng)新互聯(lián)科技有限公司重慶分公司 <a target="_blank">渝ICP備2021005571號</a></div> <!--<div id="squ6kqw" class="fr"><a target="_blank">成都網(wǎng)站建設(shè)</a>:<a target="_blank">創(chuàng)新互聯(lián)</a></div>--> </div> </div> <div id="squ6kqw" class="link"> <div id="squ6kqw" class="container"> 友情鏈接:: <a target="_blank">成都網(wǎng)站建設(shè)</a> <a target="_blank">重慶網(wǎng)站建設(shè)</a> <a href="">四川網(wǎng)站建設(shè)</a> <a href="">重慶建設(shè)網(wǎng)站</a> <a target="_blank">移動(dòng)服務(wù)器托管</a> <a target="_blank">成都服務(wù)器托管</a> <a target="_blank">云服務(wù)器</a> <a target="_blank">廣告設(shè)計(jì)制作</a> <a target="_blank">重慶網(wǎng)頁設(shè)計(jì)</a> <a target="_blank">重慶做網(wǎng)站</a> <a target="_blank">重慶網(wǎng)站制作</a> <a href="">重慶網(wǎng)站建設(shè)</a> <a href="">重慶網(wǎng)站公司</a> <a href="">渝中網(wǎng)站制作</a> <a href="">重慶網(wǎng)站設(shè)計(jì)</a> </div> </div> </div> <div id="squ6kqw" class="foot"> <ul class="public-celan"> <li> <a target="_blank" class="a1 db tc"> <img src="/Public/Home/img/icon-23.png" alt="" class="db auto"> <span id="squ6kqw" class="span-txt">在線咨詢</span> </a> </li> <li> <a href="tel:18980820575" class="a1 db tc"> <img src="/Public/Home/img/icon-24.png" alt="" class="db auto"> <span id="squ6kqw" class="span-txt">電話咨詢</span> </a> </li> <li> <a target="_blank" href="tencent://message/?uin=1683211881&Site=&Menu=yes" class="a1 db tc"> <img src="/Public/Home/img/icon-25.png" alt="" class="db auto"> <span id="squ6kqw" class="span-txt">QQ咨詢</span> </a> </li> <li> <a target="_blank" href="tencent://message/?uin=532337155&Site=&Menu=yes" class="a1 db tc public-yuyue-up"> <img src="/Public/Home/img/icon-26.png" alt="" class="db auto"> <span id="squ6kqw" class="span-txt">預(yù)約顧問</span> </a> </li> </ul> </div> <div id="squ6kqw" class="customer"> <dl class="icon1"> <dt> <a href="tencent://message/?uin=1683211881&Site=&Menu=yes"> <i class="iconT"><img src="/Public/Home/img/QQ.png" alt=""></i> <p>在線咨詢</p> </a> </dt> </dl> <dl class="icon2"> <dt><i><img src="/Public/Home/img/weixin.png" alt=""></i><p>微信咨詢</p></dt> <dd><img src="/Public/Home/img/ewm.png"></dd> </dl> <dl class="icon3"> <dt><i><img src="/Public/Home/img/dianhua.png" alt=""></i><p>電話咨詢</p></dt> <dd> <p>028-86922220(工作日)</p> <p>18980820575(7×24)</p> </dd> </dl> <dl class="icon4"> <dt class="sShow"> <a href="tencent://message/?uin=244261566&Site=&Menu=yes"> <i><img src="/Public/Home/img/dengji.png" alt=""></i><p>提交需求</p> </a> </dt> </dl> <dl class="icon5"> <dt class="gotop"> <a href="#top"> <i><img src="/Public/Home/img/top.png" alt=""></i><p>返回頂部</p> </a> </dt> </dl> </div> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://weahome.cn/" title="真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆">真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆</a> <div class="friend-links"> </div> </div> </footer> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body><div id="g4s4e" class="pl_css_ganrao" style="display: none;"><tfoot id="g4s4e"></tfoot><abbr id="g4s4e"></abbr><samp id="g4s4e"></samp><noscript id="g4s4e"></noscript><xmp id="g4s4e"><tr id="g4s4e"><s id="g4s4e"></s></tr></xmp><noscript id="g4s4e"></noscript><delect id="g4s4e"><tr id="g4s4e"><rt id="g4s4e"></rt></tr></delect><sup id="g4s4e"></sup><td id="g4s4e"></td><sup id="g4s4e"></sup><strong id="g4s4e"><abbr id="g4s4e"><kbd id="g4s4e"></kbd></abbr></strong><center id="g4s4e"></center><option id="g4s4e"><rt id="g4s4e"><fieldset id="g4s4e"></fieldset></rt></option><pre id="g4s4e"></pre><blockquote id="g4s4e"><tfoot id="g4s4e"><object id="g4s4e"></object></tfoot></blockquote><acronym id="g4s4e"></acronym><code id="g4s4e"><optgroup id="g4s4e"><abbr id="g4s4e"></abbr></optgroup></code><noscript id="g4s4e"></noscript><input id="g4s4e"><tbody id="g4s4e"><button id="g4s4e"></button></tbody></input><noscript id="g4s4e"></noscript><tbody id="g4s4e"><object id="g4s4e"><small id="g4s4e"></small></object></tbody><button id="g4s4e"><samp id="g4s4e"><tbody id="g4s4e"></tbody></samp></button><object id="g4s4e"></object><center id="g4s4e"><dd id="g4s4e"><th id="g4s4e"></th></dd></center><delect id="g4s4e"><tr id="g4s4e"><rt id="g4s4e"></rt></tr></delect><tr id="g4s4e"></tr><strong id="g4s4e"></strong><pre id="g4s4e"></pre><nav id="g4s4e"></nav><em id="g4s4e"><del id="g4s4e"><dfn id="g4s4e"></dfn></del></em><abbr id="g4s4e"></abbr><tfoot id="g4s4e"></tfoot><cite id="g4s4e"><nav id="g4s4e"><li id="g4s4e"></li></nav></cite><center id="g4s4e"></center><rt id="g4s4e"><fieldset id="g4s4e"><optgroup id="g4s4e"></optgroup></fieldset></rt><acronym id="g4s4e"></acronym><xmp id="g4s4e"><tr id="g4s4e"><rt id="g4s4e"></rt></tr></xmp><kbd id="g4s4e"><acronym id="g4s4e"><dd id="g4s4e"></dd></acronym></kbd><del id="g4s4e"></del><kbd id="g4s4e"></kbd><optgroup id="g4s4e"><tbody id="g4s4e"><button id="g4s4e"></button></tbody></optgroup><delect id="g4s4e"><tr id="g4s4e"><rt id="g4s4e"></rt></tr></delect><source id="g4s4e"><cite id="g4s4e"><nav id="g4s4e"></nav></cite></source><wbr id="g4s4e"><cite id="g4s4e"><nav id="g4s4e"></nav></cite></wbr><menu id="g4s4e"></menu><center id="g4s4e"></center><td id="g4s4e"></td><rt id="g4s4e"></rt><abbr id="g4s4e"></abbr><tfoot id="g4s4e"><input id="g4s4e"><small id="g4s4e"></small></input></tfoot><source id="g4s4e"><strong id="g4s4e"><abbr id="g4s4e"></abbr></strong></source><tfoot id="g4s4e"><source id="g4s4e"><small id="g4s4e"></small></source></tfoot><sup id="g4s4e"><blockquote id="g4s4e"><tfoot id="g4s4e"></tfoot></blockquote></sup><noframes id="g4s4e"><ul id="g4s4e"><pre id="g4s4e"></pre></ul></noframes><td id="g4s4e"><fieldset id="g4s4e"><optgroup id="g4s4e"></optgroup></fieldset></td><s id="g4s4e"></s><input id="g4s4e"></input><em id="g4s4e"><del id="g4s4e"><dfn id="g4s4e"></dfn></del></em><tfoot id="g4s4e"></tfoot><pre id="g4s4e"><wbr id="g4s4e"><cite id="g4s4e"></cite></wbr></pre><rt id="g4s4e"><code id="g4s4e"><table id="g4s4e"></table></code></rt><tr id="g4s4e"></tr><input id="g4s4e"></input><option id="g4s4e"><del id="g4s4e"><dfn id="g4s4e"></dfn></del></option><noscript id="g4s4e"></noscript><source id="g4s4e"><cite id="g4s4e"><abbr id="g4s4e"></abbr></cite></source><center id="g4s4e"></center><input id="g4s4e"><tbody id="g4s4e"><button id="g4s4e"></button></tbody></input><del id="g4s4e"></del><wbr id="g4s4e"></wbr><li id="g4s4e"></li><del id="g4s4e"><dfn id="g4s4e"><center id="g4s4e"></center></dfn></del><td id="g4s4e"></td><tr id="g4s4e"></tr><input id="g4s4e"></input><tbody id="g4s4e"></tbody><center id="g4s4e"><dd id="g4s4e"><th id="g4s4e"></th></dd></center><strike id="g4s4e"></strike><noscript id="g4s4e"></noscript><tbody id="g4s4e"></tbody><delect id="g4s4e"><strike id="g4s4e"><rt id="g4s4e"></rt></strike></delect><s id="g4s4e"></s><dfn id="g4s4e"><td id="g4s4e"><fieldset id="g4s4e"></fieldset></td></dfn><strong id="g4s4e"></strong><small id="g4s4e"><abbr id="g4s4e"><kbd id="g4s4e"></kbd></abbr></small><td id="g4s4e"><fieldset id="g4s4e"><optgroup id="g4s4e"></optgroup></fieldset></td><strike id="g4s4e"></strike><strike id="g4s4e"><s id="g4s4e"><bdo id="g4s4e"></bdo></s></strike><source id="g4s4e"><strong id="g4s4e"><abbr id="g4s4e"></abbr></strong></source><blockquote id="g4s4e"></blockquote><samp id="g4s4e"></samp><strong id="g4s4e"></strong><optgroup id="g4s4e"><tbody id="g4s4e"><button id="g4s4e"></button></tbody></optgroup><strong id="g4s4e"></strong><tfoot id="g4s4e"></tfoot><dfn id="g4s4e"></dfn><pre id="g4s4e"></pre><small id="g4s4e"></small><blockquote id="g4s4e"></blockquote><source id="g4s4e"><strong id="g4s4e"><abbr id="g4s4e"></abbr></strong></source><dd id="g4s4e"></dd><optgroup id="g4s4e"><tbody id="g4s4e"><button id="g4s4e"></button></tbody></optgroup><pre id="g4s4e"></pre><strong id="g4s4e"><abbr id="g4s4e"><kbd id="g4s4e"></kbd></abbr></strong><button id="g4s4e"><blockquote id="g4s4e"><tbody id="g4s4e"></tbody></blockquote></button><option id="g4s4e"></option><td id="g4s4e"><fieldset id="g4s4e"><input id="g4s4e"></input></fieldset></td><em id="g4s4e"><del id="g4s4e"><dfn id="g4s4e"></dfn></del></em><abbr id="g4s4e"></abbr><kbd id="g4s4e"><acronym id="g4s4e"><dd id="g4s4e"></dd></acronym></kbd><ul id="g4s4e"></ul><strong id="g4s4e"></strong><sup id="g4s4e"></sup><kbd id="g4s4e"><acronym id="g4s4e"><xmp id="g4s4e"></xmp></acronym></kbd><li id="g4s4e"></li><strike id="g4s4e"></strike><center id="g4s4e"><wbr id="g4s4e"><th id="g4s4e"></th></wbr></center><strike id="g4s4e"></strike><code id="g4s4e"><table id="g4s4e"><tr id="g4s4e"></tr></table></code><abbr id="g4s4e"></abbr><delect id="g4s4e"><tr id="g4s4e"><rt id="g4s4e"></rt></tr></delect><em id="g4s4e"></em><input id="g4s4e"></input><sup id="g4s4e"></sup><bdo id="g4s4e"></bdo><pre id="g4s4e"></pre><em id="g4s4e"><del id="g4s4e"><dfn id="g4s4e"></dfn></del></em><em id="g4s4e"><delect id="g4s4e"><tr id="g4s4e"></tr></delect></em><sup id="g4s4e"></sup><tr id="g4s4e"><sup id="g4s4e"><center id="g4s4e"></center></sup></tr><blockquote id="g4s4e"></blockquote><td id="g4s4e"></td><td id="g4s4e"><fieldset id="g4s4e"><optgroup id="g4s4e"></optgroup></fieldset></td><acronym id="g4s4e"></acronym><noscript id="g4s4e"></noscript><button id="g4s4e"></button><blockquote id="g4s4e"></blockquote><sup id="g4s4e"><center id="g4s4e"><tfoot id="g4s4e"></tfoot></center></sup><center id="g4s4e"><dl id="g4s4e"><input id="g4s4e"></input></dl></center><samp id="g4s4e"></samp><xmp id="g4s4e"><tr id="g4s4e"><rt id="g4s4e"></rt></tr></xmp><abbr id="g4s4e"><pre id="g4s4e"><samp id="g4s4e"></samp></pre></abbr><tfoot id="g4s4e"><object id="g4s4e"><strong id="g4s4e"></strong></object></tfoot><table id="g4s4e"></table><code id="g4s4e"></code><wbr id="g4s4e"></wbr><delect id="g4s4e"></delect><nav id="g4s4e"></nav><blockquote id="g4s4e"></blockquote><dl id="g4s4e"><object id="g4s4e"><small id="g4s4e"></small></object></dl></div> </html> <script> $(".con img").each(function(){ var src = $(this).attr("src"); //獲取圖片地址 var str=new RegExp("http"); var result=str.test(src); if(result==false){ var url = "https://www.cdcxhl.com"+src; //絕對路徑 $(this).attr("src",url); } }); window.onload=function(){ document.oncontextmenu=function(){ return false; } } </script>