Link to home
Start Free TrialLog in
Avatar of urobins
urobins

asked on

is it possible to query imdb.com from my website using a jsp page

I wanted to write a JSP page for my website that would allow a user to enter a movie name and then query IMDB.com and display the page with the info on that movie.  Is this possible, and if so how would I do it?

thanks!
ASKER CERTIFIED SOLUTION
Avatar of rrz
rrz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of urobins
urobins

ASKER

sorry I am new to JSP I would like to just display the whole page in return, how would I do that?
Use the following page to call the page I posted in my first post.
<html>
<head>
<title>Movie Info</title>
</head>
<body>
<form action="getMovieInfo.jsp">
Please enter movie title:<input type="text" size="25" name="movieTitle"/>
<input type="submit" value="Get movie info"/>
</form>
</body>
</html>

But if you want the whole page you don't even need JSP. You could use the following in a frame on one of your HTML pages.  
<html>
<head>
<title>Movie Info</title>
<script>
function GetInfo(){
  window.location = "http://imdb.com/find?s=all&q=
                   + encodeURIComponent(document.movieForm.movieTitle.value);
}
</script>
</head>
<body>
<form name="movieForm">
Please enter movie title:<input type="text" size="25" name="movieTitle"/>
<input type="button" value="Get movie info" onclick="GetInfo();"/>
</form>
</body>
</html>
Avatar of urobins

ASKER

Thanks let me try this  I appreciate the help.  Now you say I can parse just certain parts, but I would need to know what they were called on IMDB Right?  I am just confused at how to pull info from a site I don't manage.  I have looked for some tutorials  but haven't found a whole lost using JSP and my book isn't all that great either.
Which book are you using ?
There is a lot of info online. Google is your friend.
Avatar of urobins

ASKER

How do I get it so I can use the Hyperlinks on the returned page?
>Now you say I can parse just certain parts  
But, I didn't say it would be easy.  Depends on what you want to do.
Avatar of urobins

ASKER

I bought Beginning Java EE5.  I found a lot of JSP info online but a lot of it is over my head, or too basic "hello world" world examples.  Thanks again.  I can get it to return the IMDB page but I have the problem where a movie title will return multiple matches and I can't select them...
Avatar of urobins

ASKER

>But, I didn't say it would be easy.  Depends on what you want to do

Oh :)  thats probly much greater than where I am at huh :)

thanks for all of your help.
I haven't read that book. But I recommend you read  
http://java.sun.com/javaee/5/docs/tutorial/doc/
Avatar of urobins

ASKER

Thank you!