What you do is called Web Scraping - there's plenty info and tools on the Internet how to do it. Let me share my way:
1. First thing you need to do, as pointed by Hugo, is to read a DOM from the website.
For that you definitely need a headless browser. The good thing is many of front-end browsers support a headless mode too. E.g., if you have Google Chrome installed you could run it from the command-line in the headless mode too to get the entire (dynamic) content of the rendered page. e.g. on Mac:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --dump-dom --disable-gpu "https://www.google.com"
2. Once you get the rendered html content you need to process it reliably.
Parsing HTML (as well as any nested data format) with line-oriented tools like sed/awk/etc is error prone, so you need to find a utility capable of parsing (extracting) data from HTML which is html-aware.
I use jtm (developed by me). This is a lossless converter from HTML/XML to JSON (and back). The reason to convert HTML into JSON is simple - JSON is the (most) widely used data model and there's a ton of JSON parsers available these days.
Once it's converted to JSON you may use any tools to extract the required info from JSON - again, there's plenty offline tools available, but I use mine - jtc - it's super fast (but that only matters for really huge JSONs) and with jtc it's really easy to extract any JSON info.
E.g., the following extracts a front list of questions from the stackoverflow:
bash $ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --dump-dom --disable-gpu "https://stackoverflow.com/questions" 2>/dev/null | jtm | jtc -w'[class]:<question-hyperlink>:[-3]><P:'
"Component LoginContainerComponent is not part of any NgModule or the module has not been imported into your module"
"Removing an object with attributes from a list?"
"Is there a Predicate for operator instanceof?"
"How to use multiple document processor in vespa.ai in separate search chain?"
"How do I load an external JS library in Svelte/Sapper?"
"Why do gcc and clang place custom-sectioned const-funcptr symbols into writable sections when compiling with -fpic?"
"How does one solve “ 'CMySQLCursor' object has no attribute 'keys'”?"
"css video iframe good practice wordpress"
"auto complete address and navigate to that place"
"How do I trace an exact or find a specific value in a matplotlib graph?"
"Swift 5 How to get JSON multilayer data to append?"
"Excel wrong data format"
"Converting React function component to class component in React-JS"
"Can't Move PTZ Camera using ONVIF Protocol -Python Client"
"Can a TypeScript HttpClient accept a string that is not explicitly formatted as JSON?"
bash $
Once the required info is extracted, you can incorporate that command line you build into your bash script.