How can I decode/parse HTML data?

I want to get data from the State Department about different countries.

I'm using https://cadatacatalog.state.gov/dataset/travel/resource/299b3b67-3c09-46a3-9eb7-9d0086581bcb as a template to build my struct for the API call.

Some items are obvious string types which aren't a problem, but others have HTML code in them.

"geopoliticalarea": "Afghanistan",
"travel_transportation": "<div style=\"margin-top:5px\">         <p><p><b>Traffic Safety and Road Conditions:</b>

How can I get the text from these objects without the HTML coding and tags?

I've searched and haven't found anything that would work.

Answered by Claude31 in 678773022

I would try to get the string and then get HTML out.

See how to here:

https://stackoverflow.com/questions/25983558/stripping-out-html-tags-from-a-string

Accepted Answer

I would try to get the string and then get HTML out.

See how to here:

https://stackoverflow.com/questions/25983558/stripping-out-html-tags-from-a-string

Thanks I'll check it out!

How can I decode/parse HTML data?
 
 
Q