Integrate third party library that generates a pricing page

I’m trying to integrate a third party library that is meant to dynamically generate a pricing page in Wix

I need to reference the external script from a script tag, and then call a function that will add the content to a dom Node.

The code, on a regular HTML page, would be something like this:

<html>
  <head>
  [...]
  <script src="https://js.test.library.com/pricing.test.js"></script>
  </head>
<body>
  <div id="pricing"></div>
  <script>
    Pricing.render('#pricing', 'PRICING_PAGE_CODE');
  </script>
</body>

Pricing being the embedded library.

From the settings, Custom code option I could add the reference script, but I don’t know how to execute it or get the reference to the DOM element where I want to render the pricing page.

how can I achieve something like this in Wix?

The only way to build HTML in Wix is through either a Custom Element (which is a web component) or the HTML element. Here are some articles to get you started on how to use those. I suggest following the tutorials first to understand how to interact with your page code and then moving on to something more complicated.

Custom Elements Example
HTML component