Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8063223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:57:15+00:00 2026-06-05T10:57:15+00:00

I have an html string that I’ve received from UIWebView from this call: NSString

  • 0

I have an html string that I’ve received from UIWebView from this call:

NSString *html = [webview stringByEvaluatingJavaScriptFromString: @"document.documentElement.innerHTML"];

the content of the NSString is:

<head>
  <meta name="viewport" content="width=508">
  <style type="text/css">
    img {max-width:100%;}
    div { margin-top: 0;margin-bottom: 0;font-family:Arial, sans-serif;}
    p{margin-top: 0;margin-bottom: 0;word-wrap:break-word;}
    table{border-collapse: collapse;}
    td{word-wrap:break-word;font-family:Arial;vertical-align:top;}
  </style>
  <style type="text/css" media="screen">
    .bumpedFont16 { font-size:1.6em; }
    .bumpedFont20 { font-size:2.0em; }
  </style>
</head>
<body>
  <div style="width:508;background-color:#FFFFFF; position:relative; overflow:hidden;word-wrap:break-word;min-height:830px; padding-left:20;padding-right:20;padding-top:20;padding-bottom:20;">
    <style type="text/css">
      .s0 {font-size: 12;font-family: Helvetica;color: rgb(0,0,0);}
      .s1 {direction:ltr;text-align: left;}
    </style>
    <p class="s1">
      <span class="s0">
        <span class="bumpedFont16">THIS IS A TEST</span>
      </span>
    </p>
  </div>
</body>

How do I get the “THIS IS A TEST” from the html string into another NSString as a plain text without any formatting ?
Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:57:17+00:00Added an answer on June 5, 2026 at 10:57 am

    In your code instead of using

    document.documentElement.innerHtml
    

    Use

    document.documentElement.innerText
    

    Inner text will return (from chrome console)

    document.documentElement.innerText  
    "THIS IS A TEST"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a string that contains the html from a page I just
I have a string of HTML that I use as jQuery input document. //
I have a HTML document that I want to remove specific tags from, identified
I have some html string that is coming from telerik radeditor, it may contain
So, I have an HTML string that looks just like this: <div> <div class=venue-tooltip>
I have an HTML string of data that i parse from an ATOM Feed.
I have an html string that I get from the response of a website.
I have a string that contains html elements such as the following var elements
I have a AJAX request that will return a string that contains some HTML
I have a string of HTML that contains a table. However in some cases

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.