How to know a URL is existing using Selenium WebDriver in C#?
up vote
0
down vote
favorite
In my application I store a list of URLs and only products that have an existing URL (ie not any 404 or Page not found or broken URL).
I want to view in my pages, then to navigate to that page. Now I need to get code that checks if the given URL is existing using WebDriver in selenium and C#.
c# selenium selenium-webdriver
add a comment |
up vote
0
down vote
favorite
In my application I store a list of URLs and only products that have an existing URL (ie not any 404 or Page not found or broken URL).
I want to view in my pages, then to navigate to that page. Now I need to get code that checks if the given URL is existing using WebDriver in selenium and C#.
c# selenium selenium-webdriver
Why not use WebClient.DownloadString(url) to do this? There is no need to involve selenium which is unefficeint.
– qaqz111
yesterday
how can I use it? How I know a page is exist or not? using this code.
– Deepak Krishna R
18 hours ago
If the page you are requesting does not exist (404), the method will throw a WebException, see MSDN here: docs.microsoft.com/en-us/dotnet/api/…
– qaqz111
7 hours ago
try{ new WebClient().DownloadString(url); } catch (WebException ex) { ... }
– qaqz111
7 hours ago
In fact the WebException is thrown by WebRequest object which is underlying inside WebClient class, so you can use WebRequest class directly too. You can google for how to use this class.
– qaqz111
7 hours ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
In my application I store a list of URLs and only products that have an existing URL (ie not any 404 or Page not found or broken URL).
I want to view in my pages, then to navigate to that page. Now I need to get code that checks if the given URL is existing using WebDriver in selenium and C#.
c# selenium selenium-webdriver
In my application I store a list of URLs and only products that have an existing URL (ie not any 404 or Page not found or broken URL).
I want to view in my pages, then to navigate to that page. Now I need to get code that checks if the given URL is existing using WebDriver in selenium and C#.
c# selenium selenium-webdriver
c# selenium selenium-webdriver
edited yesterday
Mate Mrše
516217
516217
asked yesterday
Deepak Krishna R
116
116
Why not use WebClient.DownloadString(url) to do this? There is no need to involve selenium which is unefficeint.
– qaqz111
yesterday
how can I use it? How I know a page is exist or not? using this code.
– Deepak Krishna R
18 hours ago
If the page you are requesting does not exist (404), the method will throw a WebException, see MSDN here: docs.microsoft.com/en-us/dotnet/api/…
– qaqz111
7 hours ago
try{ new WebClient().DownloadString(url); } catch (WebException ex) { ... }
– qaqz111
7 hours ago
In fact the WebException is thrown by WebRequest object which is underlying inside WebClient class, so you can use WebRequest class directly too. You can google for how to use this class.
– qaqz111
7 hours ago
add a comment |
Why not use WebClient.DownloadString(url) to do this? There is no need to involve selenium which is unefficeint.
– qaqz111
yesterday
how can I use it? How I know a page is exist or not? using this code.
– Deepak Krishna R
18 hours ago
If the page you are requesting does not exist (404), the method will throw a WebException, see MSDN here: docs.microsoft.com/en-us/dotnet/api/…
– qaqz111
7 hours ago
try{ new WebClient().DownloadString(url); } catch (WebException ex) { ... }
– qaqz111
7 hours ago
In fact the WebException is thrown by WebRequest object which is underlying inside WebClient class, so you can use WebRequest class directly too. You can google for how to use this class.
– qaqz111
7 hours ago
Why not use WebClient.DownloadString(url) to do this? There is no need to involve selenium which is unefficeint.
– qaqz111
yesterday
Why not use WebClient.DownloadString(url) to do this? There is no need to involve selenium which is unefficeint.
– qaqz111
yesterday
how can I use it? How I know a page is exist or not? using this code.
– Deepak Krishna R
18 hours ago
how can I use it? How I know a page is exist or not? using this code.
– Deepak Krishna R
18 hours ago
If the page you are requesting does not exist (404), the method will throw a WebException, see MSDN here: docs.microsoft.com/en-us/dotnet/api/…
– qaqz111
7 hours ago
If the page you are requesting does not exist (404), the method will throw a WebException, see MSDN here: docs.microsoft.com/en-us/dotnet/api/…
– qaqz111
7 hours ago
try{ new WebClient().DownloadString(url); } catch (WebException ex) { ... }
– qaqz111
7 hours ago
try{ new WebClient().DownloadString(url); } catch (WebException ex) { ... }
– qaqz111
7 hours ago
In fact the WebException is thrown by WebRequest object which is underlying inside WebClient class, so you can use WebRequest class directly too. You can google for how to use this class.
– qaqz111
7 hours ago
In fact the WebException is thrown by WebRequest object which is underlying inside WebClient class, so you can use WebRequest class directly too. You can google for how to use this class.
– qaqz111
7 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372389%2fhow-to-know-a-url-is-existing-using-selenium-webdriver-in-c%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Why not use WebClient.DownloadString(url) to do this? There is no need to involve selenium which is unefficeint.
– qaqz111
yesterday
how can I use it? How I know a page is exist or not? using this code.
– Deepak Krishna R
18 hours ago
If the page you are requesting does not exist (404), the method will throw a WebException, see MSDN here: docs.microsoft.com/en-us/dotnet/api/…
– qaqz111
7 hours ago
try{ new WebClient().DownloadString(url); } catch (WebException ex) { ... }
– qaqz111
7 hours ago
In fact the WebException is thrown by WebRequest object which is underlying inside WebClient class, so you can use WebRequest class directly too. You can google for how to use this class.
– qaqz111
7 hours ago