Hi guys,
I'm trying to download a 'JS enabled' web page through Java. But when I do, it just seems to download a page that just says "Please enable JavaScript". Is there a way to enable JS within Java? What should I use?
Thanks!
-mashi
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi guys,
I'm trying to download a 'JS enabled' web page through Java. But when I do, it just seems to download a page that just says "Please enable JavaScript". Is there a way to enable JS within Java? What should I use?
Thanks!
-mashi
Never encountered this issue before, but you could try setting the user agent to something and see if that helps.
The above is an abbreviated way to set the user agent...search the web and you will find more specific details on the appropriate value for the the agent. May not work, but its worth a shot. May be another request property you can set that might do the trickconn.setRequestProperty("User-Agent", "Mozilla 5.0");//where conn is a URLConnection
Last edited by copeg; November 13th, 2010 at 09:30 PM.