« Delphi字符串函数大全delphi的截取字符函数[1] »

获取淘宝商品信息的代码

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdHTTP;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    Edit2: TEdit;
    Edit3: TEdit;
    Button2: TButton;
    Button3: TButton;
    Edit4: TEdit;
    IdHTTP1: TIdHTTP;
    Button4: TButton;
    Memo1: TMemo;
    Edit5: TEdit;
    Edit6: TEdit;
    Edit7: TEdit;
    Edit8: TEdit;
    Memo2: TMemo;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(copy(edit1.Text,strtoint(edit2.Text),strtoint(edit3.Text)))
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
showmessage(inttostr(length(edit1.Text)))
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
showmessage(inttostr(pos(edit5.Text,edit1.Text)))
end;
function title(str:string):string;
var
str1:string;
begin
str:=trim(str);
form1.Memo1.Text:=str;
str1:=copy(str,pos('<title>',str)+7,pos('</title>',str)-pos('<title>',str)-50);
title:=str1;
end;
function ms(str:string):string;
var
str1:string;
begin
str1:=form1.idhttp1.Get('http://'+copy(str,pos('<!-- descURL ==>',str)+17,pos('-->'+#10+'  <script',str)-pos('<!-- descURL ==>',str)-17));
str1:=trim(str1);
ms:=copy(str1,11,length(str1)-12);
end;
function jg(str:string):string;
begin
jg:=copy(str,pos('一 口 价:</span><em>',str)+21,pos('</em>元',str)-pos('一 口 价:</span><em>',str)-21);
end;
function dz(str:string):string;
begin
dz:=copy(copy(str,pos('所 在 地',str)+0,pos('宝贝数量',str)-pos('所 在 地:',str)-0),18,pos('</li>',copy(str,pos('所 在 地',str),pos('宝贝数量',str)-pos('所 在 地:',str)))-18);
end;
procedure TForm1.Button4Click(Sender: TObject);
var
str1:string;
begin
str1:=idhttp1.Get(edit4.Text);
edit6.Text:=trim(title(str1));
memo2.Text:=ms(str1);
edit7.Text:=jg(str1);
edit8.Text:=dz(str1);
end;
end.

  • 24.寿光果蔬中原办事处
  • http://www.qdxhdy.com
  • 寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处寿光果蔬中原办事处
  • 2011-6-12 19:42:59 回复该留言
  • 2.莞商在线
  • http://www.gs568.com
  • 新款儿童服装抢换购中,中秋、国庆期间有优惠哦!本批发行专业批发出口欧美日韩等国家原单库存童装及婴童系列用品,多年以来,始终如一为广大新老客户提供物美价廉商品,主要品牌有:GAP、Carter’s、Gymboree、Disney、JANIEANDJACK、M
  • 2010-9-15 17:41:59 回复该留言

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

网站目录

最近发表

最新评论及回复

文章归档

Search

Powered By Z-Blog 1.8 Terminator(beta) Build 71218 Designed by Michael

Copyright 0-9999 subin.org.cn Rights Reserved. 晋ICP备08000685号