阳光网驿-企业信息化交流平台【DTC零售连锁全渠道解决方案】

 找回密码
 注册

QQ登录

只需一步,快速开始

扫描二维码登录本站

手机号码,快捷登录

手机号码,快捷登录

老司机
查看: 1198|回复: 1

DELPHI查询百度排名主要代码

[复制链接]

该用户从未签到

发表于 2010-1-7 10:58:16 | 显示全部楼层 |阅读模式
【DELPHI查询百度排名主要代码】
if SearchSite=1 then
    begin
        if PageNo = 0 then
          begin
          //========================================推广计算
          TList  :=  SplitString(str,'fm'':''pp'',''title'':');
          for i:=1 to TList.Count - 1 do
           begin
              Titem := TList;
              listbox1.Items.Add(inttostr(i));
            end ;
            del_listbox;
            ttop:=inttostr(listbox1.count);
            if strtoint(ttop) <=0 then
            begin
              ttop:='0';
            end;
          end;
         //========================================推广计算结束
      if pos(web,str) > 0 then
        begin
           List  :=  SplitString(str,'onmousedown="return c');
           for i:=0 to List.Count - 1 do
              begin
                item := List;
                  if Pos(SearchUrl ,item)<>0 then
                    begin
                      t := Pos('''p1'':',item);
                      Top := Copy(item,t+5,3);
                      Top := StringReplace(Top, '''','', flag);
                      Top := StringReplace(Top, ',','', flag);

                      if top = '0})' then
                        begin
                          application.MessageBox('您的站为百度推广站,程序拒绝检查百度推广站的排名!','愤怒提示',64);
                          AN.Enabled:=TRUE;
                          exit;
                        end;

                      if ttop = '' then ttop := '0' ;

                      LS := LV.Items.Add;
                      LS.Caption:=key ;
                      LS.SubItems.Add('搜索排名为'+inttostr((strtoint(ttop)+strtoint(top)))+'(推广'+ttop+' - 自然' +Top+')') ;
                      LS.SubItems.Add('第'+IntToStr(PageNo + 1)+'页');

                      t1:=t +1 ;
                      Top := Copy(item,t1+2,1820);
                      baidukuaizhao:=getstr(top,'K 2','</FONT>- <A class=m');
                      LS.SubItems.Add('2'+baidukuaizhao);

                      AN.Enabled:=TRUE;
                      LA1.Caption := '百度关键字查询完毕!';
                      Close;
                      del_listview;
                    if Top = '' then exit;
                     exit;
                end;
            end;
        end;

  LA1.Caption := '正在查询第 ' +IntToStr(PageNo) + ' 页';
  PageNo := PageNo + 1 ;
  Application.ProcessMessages;
  
  if (PageNo < MaxPage)  then
  begin
    newurl := 'http://www.baidu.com/s?wd='+Key+'&pn=' + IntToStr(PageNo*10);
    WebBrowser1.Navigate(newurl);
  end;
  Application.ProcessMessages;
  end;
  
  if (PageNo = MaxPage) and (top='') then
    begin
      LS := LV.Items.Add;
      LS.Caption:=key ;
      LS.SubItems.Add('在1-'+inttostr(PageNo)+'页中未查询到结果') ;
      LS.SubItems.Add('--') ;
      LS.SubItems.Add('--') ;
      LA1.Caption := '百度关键字查询完毕,未查询到结果!';
      AN.Enabled:=true;
      exit;
    end;
楼主热帖
启用邀请码注册,提高发帖质量,建设交流社区
  • TA的每日心情

    2016-5-15 17:47
  • 签到天数: 2 天

    [LV.1]初来乍到

    发表于 2010-1-7 11:24:45 | 显示全部楼层
    朋友 发错地方了吧,发到开源区哦
    启用邀请码注册,提高发帖质量,建设交流社区
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    快速回复 返回顶部 返回列表