Ecommerce Shopify WordPress Discussion

WP REST API returns combination of HTML and JSON

i am new in wordpress. i want to get wordpress pages content into android app. I have following url. https://servicetie.com/wp-json/wp/v2/pages/567 i attached its response. it is combination of html and json and it does not retrieve only content in android String url = "https://servicetie.com/wp-json/wp/v2/pages/567"; StringRequest request = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() { @Override public void onResponse(String s) { Log.e("con", s); gson = new Gson(); mapPost = (Map<String, Object>) gson.fromJson(s, Map.class); mapTitle = (Map<String, Object>) mapPost.get("title"); mapContent = (Map<String, Object>) mapPost.get("content"); String render = mapContent.get("rendered").toString(); Log.e("content", render); progressDialog.dismiss(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { progressDialog.dismiss(); // Toast.makeText(Post.this, id, Toast.LENGTH_LONG).show(); } }){ @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> params = new HashMap<String, String>(); params.put("Content-Type", "application/json"); params.put("Accept", "application/json"); return params; } }; RequestQueue rQueue = Volley.newRequestQueue(Post.this); rQueue.add(request); } its response in android is {"id":567,"date":"2024-01-11T10:32:01","date_gmt":"2024-01-11T10:32:01","guid":{"rendered":"https:\/\/www.servicetie.com\/?page_id=567"},"modified":"2024-01-28T14:18:00","modified_gmt":"2024-01-28T14:18:00","slug":"vision","status":"publish","type":"page","link":"https:\/\/www.servicetie.com\/vision\/","title":{"rendered":"Vision"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"567\" class=\"elementor elementor-567\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-4233635 e-flex e-con-boxed e-con e-parent\" data-id=\"4233635\" data-element_type=\"container\" data-settings=\"{"content_width":"boxed"}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-72d13cb elementor-widget elementor-widget-spacer\" data-id=\"72d13cb\" data-element_type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.19.0 - 07-02-2024 *\/\n.elementor-column .elementor-spacer-inner{height:var(--spacer-size)}.e-con{--container-widget-width:100%}.e-con-inner>.elementor-widget-spacer,.e-con>.elementor-widget-spacer{width:var(--container-widget-width,var(--spacer-size));--align-self:var(--container-widget-align-self,initial);--flex-shrink:0}.e-con-inner>.elementor-widget-spacer>.elementor-widget-container,.e-con>.elementor-widget-spacer>.elementor-widget-container{height:100%;width:100%}.e-con-inner>.elementor-widget-spacer>.elementor-widget-container>.elementor-spacer,.e-con>.elementor-widget-spacer>.elementor-widget-container>.elementor-spacer{height:100%}.e-con-inner>.elementor-widget-spacer>.elementor-widget-container>.elementor-spacer>.elementor-spacer-inner,.e-con>.elementor-widget-spacer>.elementor-widget-container>.elementor-spacer>.elementor-spacer-inner{height:var(--container-widget-height,var(--spacer-size))}.e-con-inner>.elementor-widget-spacer.elementor-widget-empty,.e-con>.elementor-widget-spacer.elementor-widget-empty{position:relative;min-height:22px;min-width:22px}.e-con-inner>.elementor-widget-spacer.elementor-widget-empty .elementor-widget-empty-icon,.e-con>.elementor-widget-spacer.elementor-widget-empty .elementor-widget-empty-icon{position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;padding:0;width:22px;height:22px}<\/style>\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-3ee46d9 e-con-full e-flex e-con e-parent\" data-id=\"3ee46d9\" data-element_type=\"container\" data-settings=\"{"content_width":"full"}\" data-core-v316-plus=\"true\">\n\t\t\t\t<div class=\"elementor-element elementor-element-9d66bd8 elementor-widget elementor-widget-heading\" data-id=\"9d66bd8\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.19.0 - 07-02-2024 *\/\n.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}<\/style><h2 class=\"elementor-heading-title elementor-size-default\">Our Vision<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-fb0488c e-con-full e-flex e-con e-parent\" data-id=\"fb0488c\" data-element_type=\"container\" data-settings=\"{"co 2024-02-09 10:12:13.266 9358-9358 content com.alsyeddev.servicetieapp E <div data-elementor-type="wp-page" data-elementor-id="567" class="elementor elementor-567" data-elementor-post-type="page"> <div class="elementor-element elementor-element-4233635 e-flex e-con-boxed e-con e-parent" data-id="4233635" data-element_type="container" data-settings="{"content_width":"boxed"}" data-core-v316-plus="true"> <div class="e-con-inner"> <div class="elementor-element elementor-element-72d13cb elementor-widget elementor-widget-spacer" data-id="72d13cb" data-element_type="widget" data-widget_type="spacer.default"> <div class="elementor-widget-container"> <style>/*! elementor - v3.19.0 - 07-02-2024 */ .elementor-column .elementor-spacer-inner{height:var(--spacer-size)}.e-con{--container-widget-width:100%}.e-con-inner>.elementor-widget-spacer,.e-con>.elementor-widget-spacer{width:var(--container-widget-width,var(--spacer-size));--align-self:var(--container-widget-align-self,initial);--flex-shrink:0}.e-con-inner>.elementor-widget-spacer>.elementor-widget-container,.e-con>.elementor-widget-spacer>.elementor-widget-container{height:100%;width:100%}.e-con-inner>.elementor-widget-spacer>.elementor-widget-container>.elementor-spacer,.e-con>.elementor-widget-spacer>.elementor-widget-container>.elementor-spacer{height:100%}.e-con-inner>.elementor-widget-spacer>.elementor-widget-container>.elementor-spacer>.elementor-spacer-inner,.e-con>.elementor-widget-spacer>.elementor-widget-container>.elementor-spacer>.elementor-spacer-inner{height:var(--container-widget-height,var(--spacer-size))}.e-con-inner>.elementor-widget-spacer.elementor-widget-empty,.e-con>.elementor-widget-spacer.elementor-widget-empty{position:relative;min-height:22px;min-width:22px}.e-con-inner>.elementor-widget-spacer.elementor-widget-empty .elementor-widget-empty-icon,.e-con>.elementor-widget-spacer.elementor-widget-empty .elementor-widget-empty-icon{position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;padding:0;width:22px;height:22px}</style> <div class="elementor-spacer"> <div class="elementor-spacer-inner"></div> </div> </div> </div> </div> </div> <div class="elementor-element elementor-element-3ee46d9 e-con-full e-flex e-con e-parent" data-id="3ee46d9" data-element_type="container" data-settings="{"content_width":"full"}" data-core-v316-plus="true"> <div class="elementor-element elementor-element-9d66bd8 elementor-widget elementor-widget-heading" data-id="9d66bd8" data-element_type="widget" data-widget_type="heading.default"> <div class="elementor-widget-container"> <style>/*! elementor - v3.19.0 - 07-02-2024 */ .elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}</style><h2 class="elementor-heading-title elementor-size-default">Our Vision</h2> </div> </div> </div> <div class="elementor-element elementor-element-fb0488c e-con-full e-flex e-con e-parent" data-id="fb0488c" data-element_type="container" data-settings="{"content_width":"full"}" data-core-v316-plus="true"> <div class="elementor-element elementor-element-41cd1fc elementor-widget elementor-widget-spacer" data-id="41cd1fc" data-element_type="widget" data-widget_type="spacer.default"> <div class="elementor-widget-container"> <div class="elementor-spacer"> <div class="elementor-spacer-inner"></div> </div> </div> </div> </div> <div class="elementor-element elementor-element-b0771f0 e-con-full elementor-hidden-mobile e-flex e-con e
Jsoup.parse(htmlString) Jsoup remove all html tags from html string. you have to add library in build.gradle implementation 'org.jsoup:jsoup:1.10.3'

February 13, 2024

Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.