简体   繁体   English

如何从Java Web应用程序提取数据?

[英]How to extract data from Java web application?

I need to extract data from a Java web application. 我需要从Java Web应用程序中提取数据。 To be specific I am looking to extract real time stock data from yahoo market tracker. 具体来说,我希望从Yahoo Market Tracker中提取实时股票数据。 Can anyone please suggest any method? 有人可以建议任何方法吗?

I'm not sure you can extract the data from Yahoo Market Tracker. 我不确定您可以从Yahoo Market Tracker中提取数据。 Even if you can, you might not be allowed to - I can't see any obvious terms & conditions/licensing. 即使可以,您也可能不会被允许-我看不到任何明显的条款和条件/许可。 I think (although I could be wrong, anyone got better info?) that you'll need to pay to get access to an API providing near realtime market data. 认为 (尽管我可能错了,但是有人得到了更好的信息吗?)您需要付费才能访问提供近实时市场数据的API。

There is a HTTP-based Yahoo Stock Quote API you could use to get prices, described here . 还有就是你可以用它来获得价格基于HTTP的雅虎股票报价API, 这里描述 Very simple, returns a comma-separated list of attributes for one or more stock symbols, for example: 非常简单,返回一个或多个股票代号的逗号分隔属性列表,例如:

http://finance.yahoo.com/d/quotes.csv?s=MSFT&f=snd1l1yr http://finance.yahoo.com/d/quotes.csv?s=MSFT&f=snd1l1yr

It might not be realtime enough, but it might be the best you can do for free. 它可能不够实时,但可能是您可以免费做的最好的事情。

You can use glorious HTTP protocol to do that. 您可以使用出色的HTTP协议来做到这一点。 Use any language you are comfortable with (Java, C#, VB.NET, python, ruby, php) and crawl the website you are trying to get information from. 使用您喜欢的任何语言(Java,C#,VB.NET,python,ruby,php)并网您试图从中获取信息的网站。

I need to extract data from a Java web application 我需要从Java Web应用程序中提取数据

From your standpoint, the fact that it is a Java Webapp or a PHP-one or static html pages doesn't change anything. 从您的角度来看,它是Java Webapp还是PHP-one或静态html页面,这一事实不会改变任何内容。 It is not because Java is backing the webapp that suddenly you get a "Java-way" to extract the info. 并不是因为Java支持Web应用程序,才突然使您获得“ Java方式”来提取信息。

Now in some cases there are APIs provided allowing you to interact with the data present on the website: but once again the fact that the Webapp is a Java one or not bears no importance. 现在,在某些情况下,提供了API,使您可以与网站上存在的数据进行交互:但是,再次说明Webapp是否是Java的事实并不重要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM