"I have pages with documentation on Atlassian Confluence platform. I want to make the pages dynamic so my idea is that I run a C# script every week that keeps this information up to date with information from a database."
Caveat: I really believe that Confluence already has this functionality built in or can build an addon to do it. This is the correct approach but I know nothing about that platform to tell you how. I would strongly recommend you post in their forums for assistance. The answer below is for an arbitrary site.
You aren't trying to automate a page at all then. You want to build a web app to retrieve the page contents from a database so you can update the database and the page shows the date. You cannot use Selenium for this as the changes would only impact the current session. You must change the data at the source.
That is exactly what APIs are for. You need to modify the HTML and JS running your page though. You didn't specify what JS client library you're using, if any. This will have a dramatic impact on things. For a typical web app you could do the following (again, Confluence is a platform so you have to implement it their way, go to their docs):
1) On the web server code side create a new API controller and action to return the data to be shown. If you want to be able to automate many different pages then you'll need some sort of key system to allow the HTML to identify the data to retrieve.
2) In the API, given the key, retrieve the HTML from the database and return to the client. For performance reasons you probably want to cache this data.
3) On the HTML side in place of hard coded text put in place holder divs. For each div that you want to retrieve the data from use JS to call back into your API to retrieve the HTML to be shown and then render it. If you're using Angular or Knockout or any # of client libraries then a simple binding attribute works. If you're not using any of these then JQuery can do it as well.
4) Consider putting a loading gif of some sort in while you're making the API call(s) as browsers can only make a couple API calls at a time and it could take a while.
5) SECURITY RISK: This is a security risk though as a malicious user could do a man in the middle attack to allow them to inject their own HTML into your page instead. Because of this most libraries require that you indicate the text being rendered contains HTML otherwise the HTML aspects are ignored.
Alternatively, for Confluence, consider building an extension that handles all this for you and drop the extension on the page. The platform is extensible as you can see all the existing extensions available. You should read their docs to see if you can build the same thing. This would likely be easier to maintain long term over an API and would certainly be more secure. However you'll need to contact them for support on that.