Get your CodeRanch badge!*
The moose likes Java in General and the fly likes Grab Value from Remote Website Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Grab Value from Remote Website" Watch "Grab Value from Remote Website" New topic
Author

Grab Value from Remote Website

Subliner Kemp
Greenhorn

Joined: Nov 06, 2012
Posts: 6
Hi guys, I am developing a finance application where my application will need to grab rates (forex, etc) from various banks each day. These banks publish their rates at their website. I use Java application running generic InputBufferedStream of the IO library to grab the HTML data. Most websites work. Unfortunately, there is one, which is (www.pbebank.com) website, their server refuse to respond to my program. Despite adding User Agent equals Mozilla etc. to the header of my URLConnection, I still fail to get the required data. Would appreciate help if someone knows how to. I suspect it is still the server rejecting my application as the header sent still does not match up to their acceptable format. They are rejecting spiders/crawlers. My code is as below.

Error is, the page takes a long time run this function, and after a while, it returns:
java.net.SocketException: Software caused connection abort: recv failed

Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3934
    
  17

Subliner Kemp wrote:They are rejecting spiders/crawlers....

Your application is a crawler, and they are blocking crawlers. Have you read their terms of service to ensure that what you are doing is allowed? Either way, if they block you then there isn't much you can do about it.


Steve
 
 
subject: Grab Value from Remote Website
 
Similar Threads
post url connection not working
doGet and doPost() difference
HttpUrlConnection: Login works only for first page
Connecting to Internet from my Server
java.io.IOException: Server returned HTTP response code: 400 for URL: