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. 高精度加法——经典题 洛谷p1601

    题目背景 无 题目描述 高精度加法,x相当于a+b problem,[b][color=red]不用考虑负数[/color][/b] 输入输出格式 输入格式: 分两行输入a,b<=10^500 ...

  2. java第八周作业

    分析代码: public final class LineItemKey implements Serializable { private Integer customerOrder; privat ...

  3. docker 容器跑一个应用

    虽然是个前端,但是公司比较推崇docker,感觉挺神奇,就也学了一些,再此做个笔记,以供日后回想. 我的想法是在一个centos环境中运行一个nginx服务.docker的安装就不说了,网上已经有好多 ...

  4. js string类型时间转换成Date类型

    方法一: var t = "2015-03-16";var array =  t.split("-");var dt = new Date(array[0], ...

  5. Vue-devtools安装步骤

    今天跟着网上参考的vue调试工具安装的方法,总结出更完善的步骤: 步骤一:调往链接地址 https://github.com/vuejs/vue-devtools 步骤二:解压链接地址中的包,到本地桌 ...

  6. 微信小程序前端开发踩坑(一)

    之前由于不了解微信小程序的整个的运行开发机制,走了很多的弯路,脑子灵光的可能不会遇到,这个主题系列的帖子希望可以帮助到像我一样理解能力慢的孩子. 不论是开发微信小程序还是说学习任何一门编程语言,最重要 ...

  7. wordpress 暴力破解防范

    一.author页面地址 author页面地址为 http://yoursite/?author=1 ID是自增的 请求这个地址会 301 到一个url,这个url里包含了作者的用户名.虽然不算漏洞, ...

  8. Java基于opencv—归一化

    Opencv中提供了resize函数,可以把图像调整到相同大小 Java中resize函数的声明,内部调用的都是native方法 public static void resize(Mat src, ...

  9. 准备学习wrf

    namelist.wps 中的 geog_data_path=后面的文件夹的文件即土地覆被资料:(看下图) 推荐中科院地理所承担的地球系统科学数据共享平台上共享的100m分辨率资料,官网  http: ...

  10. Java线程池不错的总结博客

    ImportNew线程池总结 Java多线程之Executor.ExecutorService.Executors.Callable.Future与FutureTask 线程池,这一篇或许就够了