java


Check whether web page exist on the web or not


I am currently using Jsoup to parse HTML document and I use the following command to get the document first
Document doc = Jsoup.connect(url).post();
if URL is not a real or existing URL, then error message will appear. So, is there any way to check that and print error message
thanks,
Zhua
It will throw an exception?
Probablly so. Why not put it in a try, and check for that kind of exception?
sth like
try{
Document doc = Jsoup.connect(url).post();
// it gets here, when it works
} catch(InvalidUrlException e){
//bla bla bla...
}
it seems easy to do so.

Related Links

Same PDF file downloaded via HttpURLConnection and wget is different
Signed pdf using timestamp itextSharp 5.x
Different XML conversion depending on containing object in list
Custom font load time
How to handle several events for the same Node in JavaFX using only one Event Handling class?
Spring with HSQLDB latest 2.4.0 version not working
Java Spark Data Encoding
Ignite data afinnity for 2 caches
Set -noverify flag in java code
Testing if an Array is empty JUNIT
Exception Handling in Morphia (Java)
Cannot get shared preferences inside custom context wrapper injection
Is the choice of Scala Akka vs Java Akka just a choice of hooks into the framework?
getting null values when trying to pass values to xml response in web service from model class
android settext only if it starts with
LocalDateFormatter day of month cardinality

Categories

HOME
vim
openlayers
cookies
single-sign-on
syntax
spring-cloud-stream
v8
jpeg
jxls
icloud
disassembler
flyway4
paradox
adfs
u-sql
moonmail
leiningen
try-catch
invantive-sql
reactive-cocoa
oxyplot
lucene.net
swiftlint
one-hot-encoding
accessor
realex-payments-api
compatibility
bpel
karaf
protovis
mozilla
io-redirection
bitbucket-pipelines
swift3.0.2
libvpx
objectlistview
document.write
lumberjack
dism
android-tabhost
quadratic-programming
node-gyp
convertapi
galleria
appcompat
errordocument
clean-architecture
veracode
forever
slickedit
worker-thread
python-cryptography
nested-sets
medium.com
azure-sdk
sts-springsourcetoolsuite
ctest
plottable.js
hill-climbing
r-tree
intel-fortran
cannon.js
kcachegrind
sframe
responsive-images
service-accounts
iiviewdeckcontroller
remobjects
pretty-print
jsapi
truevault
htmlcleaner
undefined-reference
jboss-weld
monomac
viadeo
c18
ms-project-server-2010
tidy
listings
opcache
file-locking
django-nonrel
drools-planner
jelly
referrer
quickdialog
dice
code-cleanup
libc++
gcj
f#-powerpack
inotifycollectionchanged
propagation
blitz++
zend-tool
ctp4
msdev
uiq3

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App