由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - JAVA URL question, help
相关主题
java and javascript 问题请教,有包子Java XML parser的问题
可以用Java 做机器人吗?help about javascript new window(post)
求助!怎样用java运行含Javascript的网页?[转载] Java Regular Expression Question //bow !
Java HTMLEditorKit 中取得html的text?读文件时,如何才能只将空白符当成分隔符?
Java.Net初学: 我的简单问题, 寻求简单方案问个简单的Java技术问题
JQueryRe: 恳请各位JAVA大师:有没有这样一个东西?
请教参数传递问题是否可以通过Java的程序直接导入网页?
java 1.4 直接处理 http?URI和URL
相关话题的讨论汇总
话题: java话题: url话题: address话题: html话题: census
进入Java版参与讨论
1 (共1页)
l*****0
发帖数: 179
1
Hi,
I'm using JAVA URL to download some data from U.S Census. I have a problem.
http://factfinder.census.gov/servlet/AGSGeoAddressServlet?_MapEvent=&_category=&_subcategory=&_stateSelectedFromDropDown=Pennsylvania&context=ags&programYear=50%3A420&street=1383%2BLONG%2BRUN%2BRD&city=FRIEDENSBURG&states=Pennsylvania&zip=17933&geo_id=&_p
if you copy the above url and put them into the explore. you will find the
Census
website would pop up a window saying "Factfinder cannot locate the address
you
ent
g*****g
发帖数: 34805
2
When you talk about popup, check javascript in that page.

【在 l*****0 的大作中提到】
: Hi,
: I'm using JAVA URL to download some data from U.S Census. I have a problem.
: http://factfinder.census.gov/servlet/AGSGeoAddressServlet?_MapEvent=&_category=&_subcategory=&_stateSelectedFromDropDown=Pennsylvania&context=ags&programYear=50%3A420&street=1383%2BLONG%2BRUN%2BRD&city=FRIEDENSBURG&states=Pennsylvania&zip=17933&geo_id=&_p
: if you copy the above url and put them into the explore. you will find the
: Census
: website would pop up a window saying "Factfinder cannot locate the address
: you
: ent

l*****0
发帖数: 179
3
the server uses Javascript. I don't know how to deal with it in JAVA code.

【在 g*****g 的大作中提到】
: When you talk about popup, check javascript in that page.
g*****g
发帖数: 34805
4
Usually it will return some status code and when javascript finds that
status
it pops up. So in java code you check that status code too.

【在 l*****0 的大作中提到】
: the server uses Javascript. I don't know how to deal with it in JAVA code.
l*****0
发帖数: 179
5
in its page source code:
function checkAddressValidity() {
if (document.mapForm.IS_ADDRESS_VALID.value == "N" && document.mapForm.
street.value != "") {
alert("Factfinder cannot locate the address you entered.");
document.mapForm.street.focus()
}
what's the corresponding status code in JAVA? i mean, which class and which
method can do that?

【在 g*****g 的大作中提到】
: Usually it will return some status code and when javascript finds that
: status
: it pops up. So in java code you check that status code too.

g*****g
发帖数: 34805
6
parse the html, that's it.

which

【在 l*****0 的大作中提到】
: in its page source code:
: function checkAddressValidity() {
: if (document.mapForm.IS_ADDRESS_VALID.value == "N" && document.mapForm.
: street.value != "") {
: alert("Factfinder cannot locate the address you entered.");
: document.mapForm.street.focus()
: }
: what's the corresponding status code in JAVA? i mean, which class and which
: method can do that?

l*****0
发帖数: 179
7
the problem with parsing the html is that no matter whether the popup
windows comes up or not(meaning no matter whether the server found the
address), the return html page is the same. no error message in the returned
page.

【在 g*****g 的大作中提到】
: parse the html, that's it.
:
: which

g*****g
发帖数: 34805
8
document.mapForm.IS_ADDRESS_VALID.value == N
The form value is what you should check, if you don't develop
this website, you can't expect error code.

returned

【在 l*****0 的大作中提到】
: the problem with parsing the html is that no matter whether the popup
: windows comes up or not(meaning no matter whether the server found the
: address), the return html page is the same. no error message in the returned
: page.

l*****0
发帖数: 179
9
the problem with parsing the html is that no matter whether the popup
windows comes up or not(meaning no matter whether the server found the
address), the return html page is the same. no error message in the returned
page.

【在 g*****g 的大作中提到】
: parse the html, that's it.
:
: which

l*****0
发帖数: 179
10
I fixed the problem. Thanks all.
1 (共1页)
进入Java版参与讨论
相关主题
URI和URLJava.Net初学: 我的简单问题, 寻求简单方案
java + javascript open local file? (转载)JQuery
Linux下安装一个Java软件出现异常请教参数传递问题
谁给科普一下什么是javascript?java 1.4 直接处理 http?
java and javascript 问题请教,有包子Java XML parser的问题
可以用Java 做机器人吗?help about javascript new window(post)
求助!怎样用java运行含Javascript的网页?[转载] Java Regular Expression Question //bow !
Java HTMLEditorKit 中取得html的text?读文件时,如何才能只将空白符当成分隔符?
相关话题的讨论汇总
话题: java话题: url话题: address话题: html话题: census