您好我想了解如何从此处获取特定值的所有价格示例http://www.ebay.com/sch/i.html?_sacat=0&_nkw=iphone+5&_frs=1 并返回值,以便我可以说将它们与产品名称一起添加到数据库中。
String weburl = "http://www.ebay.com/sch/i.html?_sacat=0&_nkw=iphone+5&_frs=1";
URL oracle = new URL(weburl);
BufferedReader in = new BufferedReader(
new InputStreamReader(oracle.openStream()));
String line;
while ((line = in.readLine()) != null)
{
if (line.contains("EUR</b>"))
{
String command = line.split("EUR</b>").toString();
final String value = command.substring(8);
final StringTokenizer s = new StringTokenizer(value, " ");
final String DurationString = s.nextToken();
System.out.println("Timh: " + DurationString);
}
}
in.close();
直到现在,这对我不起作用。
我该怎么改变它?