Products

Price/Order

Support

Partners

Testimonials

Test Results

About us

Contact
 RTC File Client Demo can't retrieve HTML from this web site.
Bottom
 
Total posts: 2
 Author RTC File Client Demo can't retrieve HTML from this web site.
Barry McClure

19.09.2009 18:41:05
Registered user
This is rather weird. I am using the RTC demo program File_Client.exe to try and retrieve an HTML page from a particular website. The program works fine for most web sites except this one:

http://www.stockcharts.com/symsearch/?CNQ

The query parameter should show stocks with symbols related to "CNQ". This works fine when entered from the FireFox browser but when executed through RTC the site returns a symbol not found page.

So what am I doing wrong?

TIA
Barry
Stephen Mott

21.09.2009 15:19:17
Registered user
It's because the site is checking you're a valid browser, you'll have to recompile the source and set the Agent to something the site will recognize, this seems to work:

procedure TRtcFileClient.btnPostClick(Sender: TObject);
  begin
  with DataRequest do
    begin
    with Request do
      begin
      Agent := 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7';
      Method:=AnsiString(eReqMethod.Text);
      FileName:='/'+AnsiString(eReqFileName.Text);
      Query.Text:=AnsiString(eReqQuery.Text);
      Host:=AnsiString(eReqHost.Text);
      if xSaveToFile.Checked then
        Info.asText['fname']:=eFileName.Text;
      end;
    Post;
    end;
  end;

Steve..