function DecodePJItem(sText: string): TList<TDataItem>;
var
reg: TRegEx;
mc: TMatchCollection;
item: TMatch;
dataItem: TDataItem;
begin
Result := TList<TDataItem>.Create;
sText := reg.Replace(sText, '\n', '');
sText := reg.Replace(sText, '<tr style="">.*?</tr>', ''); //
sText := reg.Replace(sText, '<td width=".*?">', '');
sText := reg.Replace(sText, '<span class.*?">', '');
sText := reg.Replace(sText, '<td class=.*?>', '');
sText := reg.Replace(sText, '<p class.*?>', '');
sText := reg.Replace(sText, '<input .*?>', '');
sText := reg.Replace(sText, '<a.*?>', '');
sText := reg.Replace(sText, '</a>', '');
sText := reg.Replace(sText, '</span>', '');
sText := reg.Replace(sText, '</tr>', '|');
sText := reg.Replace(sText, '<tr>', '');
sText := reg.Replace(sText, '</p>', '');
sText := reg.Replace(sText, '</td>', ',');
sText := reg.Replace(sText, '<span.*?>', '');
reg := TRegEx.Create('(.*?),(.*?),(.*?),(.*?),(.*?),(.*?),(.*?),(.*?),\|');
mc := reg.Matches(sText); for item in mc do
begin
if item.Groups.Count = then
begin
try
if item.Groups[].Value <> '我要买' then Continue; dataItem := TDataItem.Create;
dataItem.PublishTime := item.Groups[].Value;
dataItem.Company := item.Groups[].Value;
dataItem.Money := StrToFloatDef(item.Groups[].Value, );
dataItem.OutTime := item.Groups[].Value;
dataItem.Deduction := StrToIntDef(item.Groups[].Value, );
dataItem.Defect := item.Groups[].Value;
dataItem.TimeLength := item.Groups[].Value;
dataItem.Text := item.Groups[].Value;
dataItem.LeftDay := GetLeftValue(dataItem.OutTime); if dataItem.LeftDay <= then
begin
SendLog(TDataCollector.MainHandle,
Format('%s, %s, 数据异常,跳过!!!',[dataItem.PublishTime, dataItem.Company]));
dataItem.Free;
Continue;
end;
dataItem.YearRate := dataItem.Deduction / * / DataItem.LeftDay;
dataItem.New := True;
except
Continue;
end; Result.Add(dataItem);
end;
end;
end;

update20181214 - uGetHttpData.pas的更多相关文章

  1. GetPJData - uGetHttpData.pas

    function GetPJData(APage: Integer): string; var IdHTTP: TIdHTTP; url: string; paramsList: TStringLis ...

  2. Delphi项目构成之单元文件PAS

    单元文件是Pascal源文件,扩展名为.pas. 有三种类型的单元文件: 窗体/数据模块和框架的单元文件(form/data module and frame units),一般由Delphi自动生成 ...

  3. Delphi 包的设计思想及它与PAS、BPL、DCU、DLL、OXC的关系。

    DCP ,BPL分别是什么文件,起什么作用?你在DELPHI中建立一个package然后保存一下,看看. bpl和Dll比较相似.只是BPL是BORLAND自己弄出来的东西!!!调用也和调用DLL相似 ...

  4. 5、利用控件TVCLZip和TIdFTP压缩文件并上传到FTP的线程单元pas 改进版

    用到临界区 保护写日志的函数: 递归函数 删除目录下的所有文件: 循环创建或判断FTP的目录: 可改进的地方:循环压缩深层次目录的所以文件: 实现断点续传,或断点下载: {************** ...

  5. F2063 Could not compile used unit 'tt.pas'

    install packge error F2063 Could not compile used unit 'tt.pas' 有可能是工程的pas文件相对路径不对.在工程管理看是否能打开文件,如果打 ...

  6. Android问题-XE5提示"[DCC Fatal Error] Project1.dpr(1): F1027 Unit not found: 'System.pas' or binary equivalents (.dcu/.o)"

    问题现象:Checking project dependencies...Compiling Project1.dproj (Debug, Android)dcc command line for & ...

  7. Messages.pas里的消息

    一.Windows 消息大全 这张表拷贝自万一兄的帖子:http://www.cnblogs.com/del/archive/2008/02/25/1079970.html 但是我希望自己能把这些消息 ...

  8. 问题-RZ安装后报错“RzBorder.pas”

    错误象现:[Error] RzBorder.pas(1429): Number of elements differs from declaration [Fatal Error] RzEdit.pa ...

  9. 问题-[致命错误] Project1.dpr(1): Unit not found: 'System.pas' or binary equivalents (DCU,DPU)

    问题现象:[致命错误] Project1.dpr(1): Unit not found: 'System.pas' or binary equivalents (DCU,DPU) 问题原因:由于删除D ...

随机推荐

  1. SharePoint Framework 基于团队的开发(三)

    博客地址:http://blog.csdn.net/FoxDave 用内部包进行开发 由于你的团队在开发客户端解决方案,你很可能构建通用代码库来在项目中重用.在很多情况下这种库包含的代码是内部所有的不 ...

  2. PyQt5 -pycharm 环境搭建

    1.安装PyQt5 在CMD窗口执行命令: pip3 install PyQt5 安装 pyqt_toools pip3 install PyQt5-tools 2.配置PyCharm 1)打开PyC ...

  3. python—DAY1

    # user = "123"# possword = "111"# count = 0## while count < 3:# user_name = i ...

  4. json序列化NULL

    在项目中遇到一问题,json序列化需要将null传递给前端,但之前项目中使用的都是fastjson的JSONObject.toJSONString(vo),这样会过滤掉为NULL的属性. 解决办法: ...

  5. 2186 Popular Cows

    Popular Cows Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 41771   Accepted: 16955 De ...

  6. [C# 基础知识系列]专题五:当点击按钮时触发Click事件背后发生的事情 (转载)

    当我们在点击窗口中的Button控件VS会帮我们自动生成一些代码,我们只需要在Click方法中写一些自己的代码就可以实现触发Click事件后我们Click方法中代码就会执行,然而我一直有一个疑问的—— ...

  7. calc()

    什么是calc()? 学习calc()之前,我们有必要先知道calc()是什么?只有知道了他是个什么东东?在实际运用中更好的使用他. calc()从字面我们可以把他理解为一个函数function.其实 ...

  8. ---————for循环打印爱心

    //打印爱心public class Xin{ public static void main (String [] args){ for(int i=1;i<=4;i++){ for(int ...

  9. parallel::ForkManager

    use Parallel::ForkManager; my $MAX_PROCESSES=10;   #申明最大进程数(一次创建的进程越多,越耗内存): my $pm = new Parallel:: ...

  10. sort_gff.py

    import sys infile = sys.argv[1]outfile = sys.argv[2] gff_list = []fh = open(infile)for x in fh:    i ...