开发者

Accessing an iframe page through Apache's HttpClient

I've been working on parsing a website but am running into problems when one of the major pages I need to parse can only be found in an iframe.

I can see the URL to the parent page and have attempted many times to visit it through HttpGet (after being logged in of course and being able to visit any other account specific page), but it fails. In fact, the page that I am given is the page a user would get if they were not logged in at all. Yet in the line above my HttpGet execute for this iframe parent I show that I am logged in via cookies.

In short, how can I access an iframe 开发者_StackOverflowparent page and stay logged in?


I believe this is due to the fact that your logged cookie is not associated with the second request made by the iframe and thus redirecting you to the login page.

You should be able to view the iframe by requesting it seperately and passing it your logged cookie. eg

HttpURLConnection.setRequestProperty("Cookie", "JSESSIONID=" + sessionId);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜