简体   繁体   English

Web抓取/从Tizen网站获取数据

[英]Web Scraping / Getting data from website in Tizen

I am absolutely new to Tizen and I would like to develop an app for the Samsung Gear S2 that gives me the current departure times of the bus and tram at several stations in my town. 我是Tizen的新手,我想为Samsung Gear S2开发一个应用程序,该应用程序向我提供了我镇上多个车站的公交和有轨电车的当前出发时间。 (So that I don't always have to get my phone from the pocket) (这样我就不必总是从口袋里拿起手机了)
So, is it possible that the app sends an HTTP request to the web server where the departures are displayed and then it "scrapes" the specific data which I need? 那么,应用程序是否有可能将HTTP请求发送到显示离开情况的Web服务器,然后“抓取”我需要的特定数据? I would prefer the Web application but a Native application (written in C) would be okay as well, if that's not possible with HTML5 and JavaScript. 我更喜欢Web应用程序,但如果HTML5和JavaScript无法实现,则本机应用程序(用C编写)也可以。

To make this more clear, the departure times in my case are displayed eg for a specific station here: http://old-m.dvb.de/de/abfahrtsmonitor/abfahrten.do?id=33000588 为了更清楚地说明这一点,在我的情况下,例如在此处显示特定车站的发车时间: http : //old-m.dvb.de/de/abfahrtsmonitor/abfahrten.do?id=33000588
Sorry, it's a German web site but I think you know what I mean. 抱歉,这是一个德国网站,但我想您知道我的意思。 So, I would like to scrape for example the next 10 lines, their destinations and the time of arrival. 因此,我想举例说明接下来的10条线,它们的目的地和到达时间。

Any idea how to do that in Tizen or at least in general? 知道如何在Tizen或至少在一般情况下这样做吗?

I solved it. 我解决了 I didn't know that cross origin requests are allowed in Tizen, so I just made an http request via Ajax and filtered the specific data. 我不知道Tizen中允许跨源请求,因此我只是通过Ajax发出了一个http请求,并过滤了特定数据。

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

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