Redian新闻
>
求助!怎样用java运行含Javascript的网页?
avatar
求助!怎样用java运行含Javascript的网页?# Java - 爪哇娇娃
b*r
1
比如有个简单的含javacript的网页A(URL已知), 在空格里输入一个数,按submit之后
就转到另一个网面B。现在想知道能不能在java下输入一个数,然后获得网页B的URL或htm
l代码。
现在已经做到了可以用Java下载指定URL的html源代码。不知道下一步该怎么办。请指教
avatar
c*y
2
If you get the source code for page A, then do a search in the source file and
you will find the URL for page B (this in the form definition after the
action=XXXXXXX.yyy You can also find out the name of the field (where you
input new value) and all the required field name. And finally put up a URL
like this:
XXXXXX.yyy?fieldname1=xxx&fieldname2=zzzzzz
then open a http connection to this URL in your java program, it should work.

【 在 breadbear (执子之手, 与子偕老) 的大作中提到: 】

就转到另一个网面B。现在想知道能不能在
avatar
w*t
3
not really - for simple web pages, maybe. normally, you'll get a lot
exceptions for a well designed web app. - exceptions such as missing
attributes/parameters, let alone may not be able to pass security check.
but, I am not sure what the original guy is trying to do. In a well designed
app, getting html code does not give you any more information than just
looking at the rendered html page

and
work.
在空格里输入一个数,按submit之
就转到另一个网面B。现在想知道能不能在java下输入一个数,然后获得网页B的URL或htm


【在 c*y 的大作中提到】
: If you get the source code for page A, then do a search in the source file and
: you will find the URL for page B (this in the form definition after the
: action=XXXXXXX.yyy You can also find out the name of the field (where you
: input new value) and all the required field name. And finally put up a URL
: like this:
: XXXXXX.yyy?fieldname1=xxx&fieldname2=zzzzzz
: then open a http connection to this URL in your java program, it should work.
:
: 【 在 breadbear (执子之手, 与子偕老) 的大作中提到: 】
: 后

avatar
b*e
4
You should try
http://jakarta.apache.org/jmeter/


就转到另一个网面B。现在想知道能不能在java下输入一个数,然后获得网页B的URL或htm


【在 b*******r 的大作中提到】
: 比如有个简单的含javacript的网页A(URL已知), 在空格里输入一个数,按submit之后
: 就转到另一个网面B。现在想知道能不能在java下输入一个数,然后获得网页B的URL或htm
: l代码。
: 现在已经做到了可以用Java下载指定URL的html源代码。不知道下一步该怎么办。请指教
: 。

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。