4
Next, I have a code that performs reading of a particular web page:
private string GetCodePage()
{
WebRequest request = WebRequest.Create(URL);
WebResponse response = request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
var codePage = reader.ReadToEnd();
reader.Close();
response.Close();
return codePage;
}
I am trying to make the same code with . NET Core, but the classes have changed, for example, there is no longer the method WebRequest.GetResponse
.
Does anyone know how to read html pages by Dotnet Core?
What do you mean by "reading" web page? Save page source on disk?
– Jéf Bueno
I have a robot that obtains information through the source of the pages. If the solution is to download the source, it is no problem, because I can read as a file.
– Guilherme Silva