Hi all, I'm very, very new to Java / Javascript, but have a couple of years experience with other programming languages. - (inexperience may explain a novicey question

However, I wanted to learn a web-enabled language to capture data from certain websites to build systems for my "sports-betting" hobby.

I've only picked up Java about a week ago, but i've managed to build a couple of programs that do what i need. However, certain sites require you to "log in" before you can access pages. So whilst I can see this information myself, my little java program cannot.

For example the racing post website (www.racingpost.co.uk) i have a username: nutricomms and password: vinery (its free to register, so no real need to hide the details). I can't get my little program to access these pages.

I have no idea where to start in looking into this problem and wondered if
a) this is the correct place to ask?
b) if anyone can give me any pointers on how to solve my little problem

any help will be gratefully received.

thanks :confused:

Guys,

could anyone please indicate whether this is even in the correct thread? or should i write it in the "java" thread?

thanks

jake

Jake,

That depends really on what language you're using. You mention both Java and JavaScript. They aren't interchangeable, and are indeed very different languages.

Plus, I'm not clear on your question. No language will let you "access" a password protected page. What exactly are you trying to do, and with which programming language?

Javascript is definitely NOT the way to go to password protect pages. Since the Javascript source is available for your visitors to read it is not hard to reverse engineer the code to work out what the password must be with most such scripts.

guys,

thanks for the replies.

tgreer, in response. (this will actually answer my second question myself, so i'm feeling a bit foolish).

I'm currently writing a few Java programs to scrape a website. unfortunately i've hit an issue with the racingpost website, as some of the pages are directed to a "restricted access" page. Its free subscription, so i've already got an account with them, but i have no idea about how to write the java to "feed" the username / password to the racingpost server.


i only started learning java a few days ago, and (embarassingly) i wasn't sure when i posted the question, whether the problem was going to be understanding the "javascript" in the website or the "java" code that i'm writing to send the details. I'm not actually sure what code is behind the scenes of the racingpost website any more either or how many interactions there are between the racingpost and my browser!)

can you confirm that i really need to post this into the java forum.....and if so i'll let it slide quietly off the bottom

(i also think i need to understand more of what i'm doing before i post the question again anywhere!!)

thanks

jake

Yes, the Java forum. JavaScript is client-side. It will only run in a client browser. In other words, you can't make YOUR JavaScript run in someone else's page.

thanks tgreer,

think i'm going to go away and learn a bit more of the basics before i post my request in the java forum though ;-)

thanks again for the advice.

jake

This article has been dead for over six months. Start a new discussion instead.