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. adaboost 参数选择

    先看下ababoost和决策树效果对比 import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection ...

  2. 新手学习之浅析一下c/c++中的指针

    一.我们先来回忆一下指针的概念吧,方便下面的介绍 指针是存放地址值的变量或者常量.例如:int a=1;&a就表示指针常量(“&”表示取地址运算符,也即引用).int *b,b表示的是 ...

  3. 微信小程序页面列表与详情页跳转的正确姿势

    初学小程序,碰到列表与详情页跳转遇到的问题,记录一下. 一.问题 1个列表页: 1个详情页: 列表页代码: onLoad:异步查询数据并setData 详情页代码: 保存成功后,调用navigateB ...

  4. Flutter不完全安裝指南(AndroidStudio集成)

    Flutter是谷歌的移动UI框架,可以快速在iOS和Android上构建高质量的原生用户界面.真心無力吐槽這些所谓的中文站以及社区的文档,整理一下安装流程吧. 本人是android开发,基于此基础上 ...

  5. ZT Linux可用的最新版本的sublime text注册

    更改hosts:sudo vim /private/etc/hosts 127.0.0.1 www.sublimetext.com 127.0.0.1 license.sublimehq.com 1 ...

  6. iOS常用算法

    1.冒泡排序 冒泡算法是一种基础的排序算法,这种算法会重复的比较数组中相邻的两个元素,如果一个元素比另一个元素大/小,那么就交换这两个元素的位置.重复一直比较到最后一个元素. 1.最差时间复杂度:O( ...

  7. SharePoint 2013 解惑 无法打开文件浏览器

    你有时候会看到这东西谈出来,当你想像管理文件一样,管理SharePoint上资源的时候 意思是说,不能打开文件浏览器,请加入你的站点到信任站点,这个有两个问题,一个是IE设置,一个是WebClient ...

  8. VI操作

    [[ 开头]] 结尾[[^ 开头第一个字符]]$  结尾最后一个字符 以下转载自:http://www.cnblogs.com/88999660/articles/1581524.html 进入vi的 ...

  9. RxJS核心概念之Subjet在angular2+上的应用

    Subject,在RxJS中是一类特殊的Observable(可观察对象),它可像多个Observer(观察者)推送值.每一个Subject也可以作为Observer(观察者) Subject同样也是 ...

  10. python-markdown

    python-markdown无法将“`生成标签问题解决方法 2种都是代码区块 ```swift is Int ``` is Int