0
votes

I'm trying to login to http://britishairways.com/ using Ben Nadel's CFHTTPSession.cfc, but am having trouble getting it to work. I'm not sure what I'm missing or overlooking.

Here is my code:

<cfset objResponse = objHttpSession
    .NewRequest( "https://www.britishairways.com/travel/home/execclub/_gf/en_us" )
    .Get()/>

<cfset objResponse = objHttpSession
    .NewRequest( "https://www.britishairways.com/travel/loginr/public/en_us" )
    .AddFormField( "membershipNumber", "#username#" )
    .AddFormField( "password", "#password#") 
    .AddFormField( "Directional_Login","/travel/home/execclub/_gf/en_us" )
    .AddFormField( "eId", "109001") 
    .AddFormField( "URLMembershipType", "onbusiness") 
    .AddFormField( "rememberLogin", "false") 
    .Post()/>  

<cfset objResponse = objHttpSession
    .NewRequest( "https://www.britishairways.com/travel/home/execclub/_gf/en_us" ).Get()/>
1
Can you clarify what you mean by "having trouble getting it to work"? What is the actual result of the code above? What did you expect it to do differently? - Leigh
ah, sorry for being a bit ambiguous. I'm expecting the result of the last .get() call to be a form that shows i'm logged in. I tried replicating the login processes based on viewing what is submitted using firebug, but for whatever reason I can't seem to it right. The last get() call still shows the form as if the user isn't logged in. - jeb

1 Answers

4
votes

Most airlines (and other travel related sites) have quite tight systems around monitoring for what they would refer to as "screen scraping", e.g. automated attempts against their systems, so you are probably running into that as a road block.

Also by doing what you are doing you are in breach of their web site terms of use (http://www.britishairways.com/en-gb/information/legal/website-terms-conditions), specifically:

use ‘screen scraping’, any automated algorithm, device, method, system, software or manual process to access, use, search, copy, monitor or extract Material (in whole or in part) from or through using this website unless We have given Our express written agreement;

You could therefore face legal action against you from BA for what you are doing. I would stop.

Sorry, I'm sure that is not what you want to hear.