Q:

Is it possible to verify if a css selector is present on a remote page?

I want to check some informations on remote Web pages with C#.
First question, is it possible to load completely (with Javascript) a Web page without using a Web Browser, just with the URL ?
Second question, is it possible to verify if a css selector is present on a remote page without browser, just with the URL ?
Thank you for listening !

A:

If you mean 'remote' instead of 'distant' then - yes, kind off.
Your question begins asking about C# and then mentions javascript.
Not sure why the change in language context - but I will try to answer both.

Can you load a page using Javascript.
Yes: What you need to do, is perform a GET request on a URL.
The interesting thing about what you are doing with Javascript at this stage, is that any GET request you do from within a web browser context, will have access to the cookies and authentication that has been setup within that browsing session- particularly good for Test Automation. Eg: You need to download a PDF, but the PDF is protected by authentication checks.

    xmlhttp=new XMLHttpRequest();
    xmlhttp.open("GET", "http://www.google.com", false);
    xmlhttp.send();
    var data = JSON.parse(xmlhttp.responseText);

This returns the html content of the URL that you request, or the binary content if it is a binary file.
In the case where it is html content, you can then use javascript to change your current page source to be equal to the page source you just requested.
eg: 
document.documentElement.innerHTML = myReturnedData;
The page will instantly load and display the returned page content.

if you want to verify if a CSS Selector exists / is valid for a remote page, then the first step you need to do, is to download the page source for that remote page.
I recommend using HtmlAgilityPack and its extension package
https://github.com/hcesar/HtmlAgilityPack.CssSelector

Once you install these, you will be able to instantiate the HtmlDocument and then query the document using the locator you specify.
var doc = new HtmlAgilityPack.HtmlDocument();
doc.Load("test.html");

IList<HtmlNode> nodes = doc.QuerySelectorAll("div .my-class[data-attr=123] > ul li");
HtmlNode node = nodes.QuerySelector("p.with-this-class span[data-myattr]");

