download Webpage,complete in .Net c#

Plaza, JaysonMark 1 Reputation point
2022-10-13T10:07:26.707+00:00

I am currently developing a .NET application that will download the html page and take the variables from the html page but whenever i download the webpage , it always give me the source code and not the entire webpage. I noticed that whenever i right click on the page . there are 3 file type options to save the html page (webpage single file, web page HTML only , webpage Complete.)
i wanna know how to download the entire page completely, I always get the html only version of web page

Thanks,
JM

Developer technologies | .NET | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2022-10-13T21:31:32.347+00:00

    the source is what is returned from the request. you must parse the returned html to get the other elements. if the page uses javascript to render elements, you must execute this javascript. this will require parsing the html into a dom, and a javascript runtime. you code would need to implement the javascript to browser dom api.

    now days, your code would host a headless chrome to do this. you can write you own wrapper for this or use one of the sdks like Selenium or Puppeteer.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.