50,523
社区成员
发帖
与我相关
我的任务
分享
public static boolean GetWebPrice(java.sql.Date lDate){
//抓取网价
URL strUrl = null;
URLConnection uConn = null;
BufferedReader br = null;
try{
strUrl = new URL("http://www.ex-silver.com/nettrading.php?big_type_id=4&small_type_id=11");
uConn = strUrl.openConnection();
br = new BufferedReader(
new InputStreamReader(
uConn.getInputStream()));
String inputLine;
while((inputLine = br.readLine())!=null)
{
System.out.println(inputLine);
}
}
catch (MalformedURLException e)
{
e.printStackTrace();
return false;
}
catch (IOException e)
{
e.printStackTrace();
return false;
}
finally
{
if(br != null )
{
try
{
br.close();
}
catch (IOException e)
{
e.printStackTrace();
return false;
}
}
}
return true;
}