Is a url valid
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Charly
am 28 Jul. 2014
Kommentiert: Image Analyst
am 29 Jul. 2014
Hello,
I'd like to know if a url is valid or not.
For example :
- http://www.fkhzfziufhzoij.com is not valid
- http://www.mathworks.fr is valid
Do you think it's possible ? thank you
0 Kommentare
Akzeptierte Antwort
Geoff Hayes
am 28 Jul. 2014
The documentation for urlread indicates that you could use the status output variable to indicate if the operation is successful or not.
For your two examples,
[str,status] = urlread('http://www.fkhzfziufhzoij.com');
returns an empty str and status==0.
Whereas,
[str,status] = urlread('http://www.mathworks.fr');
returns the HTML for the page in str and status==1.
3 Kommentare
Geoff Hayes
am 29 Jul. 2014
Are you copying the lines of code exactly as above? What does str return for each? If you paste just the URL into your internet browser, what happens?
Image Analyst
am 29 Jul. 2014
I get the same results as Geoff. Can you see anything in your web browser? Maybe it's some firewall issue???
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Scope Variables and Generate Names finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!