Home > Back-end >  [for] IDHTTP GET asked what cannot increase hits?
[for] IDHTTP GET asked what cannot increase hits?

Time:09-27

Under pressure to develop an automatic click website news recently small tools, use IDHTTP components, but have no effect after the run
With Internet explorer click http://10.72.1.215/jwywTj.do? InfoId=# # # will record through the IP, and feedback "IP has been recorded", again with IE browser click will be prompted to "IP has been recorded, please do not repeat click"

Use IDHTTP. GET (' http://10.72.1.215/jwywTj.do? InfoId=# # # ') will only feedback "IP has been recorded, so also run again, don't know what it is

The code is as follows:
Procedure TForm1. FormCreate (Sender: TObject);
Var
Reg: TPerlRegEx;
The List: TStringList;
The begin
Reg:=TPerlRegEx. Create (nil);
Memo1. The Clear;
Memo1. Lines. The Add (" this program automatically click every hour, please minimize to the taskbar, '+ CRH (13) + CRH (10));
Try
Reg. Subject:=idhttp1. Get (edit1. Text);
Except,
Memo1. Lines. The Add (' website read timeout... ');
The end;
Reg. Regex:='(? <=\ \ \ d + b)/b (?=\ b.h HTML \ b) ';
While reg. MatchAgain do
The begin
Memo1. Lines. The Add (FormatDateTime (' c ', now));
Memo1. Lines. The Add (' access to news of the police ID: + reg. MatchedExpression + ");
Try
Idhttp1. Request. AcceptLanguage:='useful - cn;
Idhttp1. Request. ContentType:='application/x - WWW - form - urlencoded';
Idhttp1. Request. UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon. The.net CLR 1.1.4322) ';
Memo1. Lines. The Add (Trim (idhttp1. Get (' http://10.72.1.215/jwywTj.do? InfoId='+ reg. MatchedExpression +')));
Click Memo1. Lines. The Add (' success! '+ CRH (13) + CRH (10));
Except,
Memo1. Lines. The Add (' website read timeout... ');
end;
end;
List:=TStringList. Create;//create a List
If FileExists (' log. TXT) then
The begin
List the LoadFromFile (' log. TXT);//data into the List
List. AddStrings (Memo1. Lines);//additional Memo text to List
List. SaveToFile (' log. TXT);//save
End
The else
The begin
List. AddStrings (Memo1. Lines);
List. SaveToFile (' log. TXT);
end;
List. Free;//release
FreeAndNil (reg);//release
end;

CodePudding user response:

May be use cookies to identify the back-end, attached cookie when you get to try

CodePudding user response:

Feeling should be the problem of cookies, to give it a try

CodePudding user response:

This use idhttp submit your accurate simulation of the submitted data, including the HTTP headers and cookies
Use the browser to submit first, record the HTTP headers and cookies, and then add the head and cookies to submit idhttp

CodePudding user response:

Statistical clicks are generally JS script, IdHttp won't perform JS

CodePudding user response:

Right on the fourth floor, in addition to internal process of access to information collection, other third party statistics was collected by js, ajax, basically unless with browser or a browser component to access, otherwise all have no statistical data

CodePudding user response:

IdHttp does not implement the js script, the problem can use the built-in WebBrowser, then find out the page submit or you have to click on the button, submit with code directly,

//to find the page elements
The class function TWBApi. GetElementObj (wb: TWebBrowser; Index: integer; TagId: string; Var obj: OleVariant) : Boolean;
Var
Doc: IHTMLDocument2;
Intf: IWebBrowser2;
OleObj: OleVariant;
The begin
Result:=false;
Try
Intf:=wb. DefaultInterface;
Doc:=intf. Document as IHTMLDocument2;//wb. Document
If doc=nil then Exit;
OleObj:=doc. All. The item (tagId, index) as IHTMLElement2;
If TVarData (oleObj). VLongWord=0 then the exit;
Obj:=oleObj;
Result:=true;
Except,
end;
end;

//simulate click
If TWbApi. GetElementObj (wb, 0, 'submit', obj) then obj. Click;

CodePudding user response:

It is prohibited to use idhttp cookies
  • Related