lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi

Thanks for the reply. Betfair is a multi million pound gambling and trading site so yes it definitely exists and is live right now.

However as it is gambling related, it is not legal in all countries. See http://www.betminded.com/countries-betfair-legal-or-banned-8091.html

I am guessing you are maybe in one of the countries where it is not allowed ?

I wonder if that is maybe related to why I get the puzzling message ? The server needs to know from what country the request is originating ?

Just noticed Paul K has replied too, and it looks like I am not using the correct call, I will go and try Pauls suggestions now

Regards Geoff

________________________________________
From: lua-l-bounces@lists.lua.org <lua-l-bounces@lists.lua.org> on behalf of Choonster TheMage <choonster.2010@gmail.com>
Sent: 24 November 2015 19:57
To: Lua mailing list
Subject: Re: How to get a webpage with Lua Socket ?

On 25 November 2015 at 06:47, Geoff Smith <spammealot1@live.co.uk> wrote:
> Hi
>
>
> I have used Lua ocket to get a few web pages downloaded in the past without
> a problem, but have hit a snag with a specific webpage I am trying to
> download.
>
> I am trying to extract some data from the Betfair homepage.
>
>
> local webText = http.request([[https://www.betfair.com/exchange/]])
>
>
> I get back a small chunk of html which contains the text "The document you
> requested has moved to a new location.  The new location is
> "https://www.betfair.com/exchange/";
>
>
> This is the exact url link I passed to the function, so cant understand why
> the problem is occurring.  If I view that site in any browser it displays
> the full web page without needing me to register or login or anything like
> that.
>
>
> So the Server is detecting I am not using a browser and not giving me the
> page I require. I have tried tinkering with the headers sent by LuaSocket to
> make it look more like a Firefox request but to no avail.
>
>
> Could anyone offer a suggestion as to what I need to do to fix this problem
> please.
>
>
> Thanks for any assistance.
>
>
> Regards Geoff

Are you sure the page still exists at that URL? I tried opening it
with Chrome and Internet Explorer and downloading with LuaSocket and
LuaSec and got the same "Sorry, we can't find this page" message each
time.

Regards,
Choonster