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

How to ignore special characters ($ ^ + () {} etc.) from string, with the help of regex expression by using replaceAll() method
Open browser and perform some actions in between the test execution of native app in android using appium java
Difference between F11 and Ctrl + F11 in eclipse?
test for Android Fragment only passes when executed first
How to make this C structure in Java [closed]
Appium - When do we use touch action? Could I have actual example for inputing text with it?
Is the a way to make a jnlp file use a 64-bit JRE?
Need a increasing number of spaces before each line
Path to specific Key/Truststore from classpath
comparing an int with an array java
what happens when u increment array. {a[in.nextInt()]++;}
How to create a map collecting on max value [closed]
Renaming lucene-core jar fails elasticsearch
How to add Markers in android Street view
Java / Command Line Arguments using a Mac Terminal
Shell script to compile and execute java program

Categories

HOME
react-virtualized
session
webstorm
setup-deployment
react-redux
jxls
win32gui
sql-server-2016
fancybox
paradox
facebook-messenger-bot
awesome-wm
vifm
nano-server
midi
google-cloud-spanner
apache-cayenne
carthage
tostring
aurigma
visjs
cx-freeze
clickonce
graphicsmagick
claims-based-identity
fish
rst2pdf
strncpy
elasticsearch-ruby
fabric8
phonegap
picasso
nssegmentedcontrol
theano.scan
reportbuilder
angularjs-factory
graphenedb
sas-visual-analytics
grid.mvc
ibpy
slick-3.0
auto-update
dotcover
upstart
datastax-startup
return-value
windows-mobile-6.5
pearson
flow-control
dwscript
messenger
abcpdf9
infix-notation
database-optimization
measures
holder.js
hexdump
itextpdf
uid
r-tree
qdialog
simple-framework
tarjans-algorithm
tableau-online
unity3d-gui
skos
typekit
preferences
rdl
funcunit
htmlcleaner
undefined-reference
mbr
aqtime
ril
gridcontrol
pushbackinputstream
html-editor
frameset
datawindow
dsn
regsvr32
vdsp
xdomainrequest
table-footer
disclosure
locate
gdlib
sudzc
asp.net-mvc-areas
gallio
dentrix
suppress
mirah
firefox-5
kdbg
ctp4
virtual-functions
phonon
premature-optimization

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App