function GetPJData(APage: Integer): string;
var
IdHTTP: TIdHTTP;
url: string;
paramsList: TStringList;
StrStream: TStringStream;
const
C_URL = 'https://www.tcpjw.com/OrderList/TradingCenter';//?pageIdx=%d';
begin
IdHTTP := TIdHTTP.Create(nil);
try
IdHTTP.Request.Accept := '*/*';
// IdHTTP.Request.AcceptEncoding := 'gzip, deflate, br';
IdHTTP.Request.AcceptLanguage := 'zh-CN,zh;q=0.9';
IdHTTP.Request.UserAgent := 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36';
IdHTTP.Request.Referer := 'https://www.tcpjw.com/OrderList/TradingCenter';
IdHTTP.Request.ContentType := 'application/x-www-form-urlencoded'; url := C_URL;// Format(C_URL, [APage]);
OutputDebugString(pchar(url));
paramsList := TStringList.Create;
try
paramsList.Add('pt_keywords=');
paramsList.Add('pt_pricestart=');
paramsList.Add('pt_priceend=');
paramsList.Add('sy_starttime=');
paramsList.Add('sy_endtime=');
paramsList.Add('pt_laststarttime=');
paramsList.Add('pt_lastendtime=');
paramsList.Add('pt_rate=');
paramsList.Add('pt_mswsxf=');
paramsList.Add('pt_mswstart=');
paramsList.Add('pt_mswend=');
paramsList.Add('pt_tradestatus=');
paramsList.Add('pt_bid=');
paramsList.Add('pt_lasttime=');
paramsList.Add('pt_flawstatus=');
paramsList.Add('pt_price=');
paramsList.Add('orderstatus=1');
paramsList.Add('pageIdx_client='+APage.ToString);
paramsList.Add('ordercolumn=');
paramsList.Add('ordertype=');
paramsList.Add('ttype=');
paramsList.Add('X-Requested-With=XMLHttpRequest'); StrStream := TStringStream.Create('', TEncoding.UTF8);
try
try
IdHTTP.Post(url, paramsList, StrStream); if IdHTTP.ResponseCode = then
Result := StrStream.DataString
else
Result := '';
except
on e: Exception do
SendLog(TDataCollector.MainHandle, 'GetPJData: ' + e.Message, True);
end;
finally
StrStream.Free;
end;
finally
paramsList.Free;
end;
finally
IdHTTP.Free;
end;
end;

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

  1. update20181214 - uGetHttpData.pas

    function DecodePJItem(sText: string): TList<TDataItem>; var reg: TRegEx; mc: TMatchCollection; ...

  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. Python第五章(北理国家精品课 嵩天等)

    函数和代码复用 函数的定义和使用 def <函数名>(<参数(0个或多个)>): <函数体> return <返回值>可选参数放在不可选参数之后*b不定 ...

  2. java面向对象编程(八)--抽象类、接口

    1.抽象类 1.1抽象类概念 当父类的一些方法不能确定时,可以用abstract关键字来修饰该方法[抽象方法],用abstract来修饰该类[抽象类]. //抽象类的必要性[Demo124.java] ...

  3. 普天同庆,微博开通,从今以后,努力用功! 狗屎一样的顺口溜!Q狗屎!!狗屎。。。。。 测试。。测试。。。没刷过微博。屯里来的。看看啥效果

    普天同庆,微博开通,从今以后,努力用功! 狗屎一样的顺口溜!Q狗屎!!狗屎..... 测试..测试...没刷过微博.屯里来的.看看啥效果

  4. 我的自定义框架 || 基于Spring Boot || 第一步

    今天在园子里面看到一位大神写的springboot做的框架,感觉挺不错,遂想起来自己还没有一个属于自己的框架,决定先将大神做好的拿过来,然后加入自己觉得需要的模块,不断完善 目前直接复制粘贴过来的,后 ...

  5. python基础语法二

    迭代 test = "妹子有种冲我来" #可迭代对象 == 被for进行循环获取 for item in test: print(item) break #练习题: test = ...

  6. Linux查看服务器配置

    服务器型号 [root@txs ~]# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Produ ...

  7. YOLOv3训练自己的数据

    1.  下载预训练权重文件 YOLOv3使用在Imagenet上预训练好的模型参数(文件名称: darknet53.conv.74,大小76MB)基础上继续训练. darknet53.conv.74下 ...

  8. python 异步发送邮件 aiosmtplib

    aiosmtplib is an asynchronous SMTP client for use with asyncio.文档地址 与 smtplib的用法大体相同 有几个地方需要注意下: 加密S ...

  9. Hailstone冰雹序列问题

    在复习数据结构,课程中提到Hailstone冰雹序列问题,问题如下 代码如下: public List<int> Hailstone(int n) { List<int> li ...

  10. JSF相关介绍

    About JavaServer Faces technology simplifies building user interfaces for JavaServer applications. D ...