Skip to main content

java maskeraiding as firefox - how?

1 reply [Last post]
chopficaro
Offline
Joined: 2010-05-01

this is a tough one, but theres got to be a way to do it. my program accesses urls, but when it tries google, google says
NO! IM GIVING U A 403!
because google doesn't like automated searches, it only wants browsers to visit google, not java programs.
the way it does this most likely is with the php variable $_SERVER['HTTP_USER_AGENT']
it tests for the browser type, and if its not one of the major browsers, it returns a 403.
i need my java program to know when it is given this request, and i need to learn how to send back any string i want, because then i can tell google that java is firefox, when its not.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chopficaro
Offline
Joined: 2010-05-01

uc.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)"); // Will set IE user agent
got it, this may also be the solution to my previous post