简体   繁体   English

Google App Engine中的Jsoup

[英]Jsoup in Google App Engine

I have used Jsoup Library to extract html from different sites. 我已经使用Jsoup库从不同站点提取html。 Jsoup Post to be Precised. Jsoup Post待定。 When i use it locally ie in java dynamic web application it runs perfectly fine. 当我在本地使用它时,即在Java动态Web应用程序中,它运行得很好。 But when i try to run on google app engine , it doesnot give required and expected data that i get when i run the program locally. 但是,当我尝试在Google App Engine上运行时,它不提供在本地运行程序时获得的所需数据和预期数据。

I use the below code to get the PNR status of the train. 我使用下面的代码来获取火车的PNR状态。 It works fine locally. 它在本地工作正常。 In google app engine it doesnot return the required data 在Google App Engine中,它不会返回所需的数据

doc=Jsoup.connect("http://www.indianrail.gov.in/cgi_bin/inet_pnrstat_cgi.cgi").timeout(300000)
                    .data("lccp_pnrno1",fullpnr).post();

Ah , still i was not able to figure it out , but i am getting the result when the application is deployed and is up and running. 啊,仍然我无法弄清楚,但是当应用程序部署并启动并运行时,我得到了结果。

I am not getting the result when i run the code locally as a google app engine web application .I used GAE plugin for eclipse. 当我作为google app引擎网络应用程序在本地运行代码时,我没有得到结果。我使用Eclipse的GAE插件。 Dont know what the issue is.But it runs when it is deployed so it does solve my problem in a way. 不知道问题是什么,但是它在部署时会运行,因此确实可以解决我的问题。 :) :)

Thanks 谢谢

here is the link to test : http://train-inquiry.appspot.com/ 这是测试的链接: http : //train-inquiry.appspot.com/

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

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