I'm trying to get the text inside a bunch of <p> elements inside a <div> This is what i have:
=importXML(C2,"//div[contains(@class,'article-body')]/p/text()") The xpath works fine on google sheets and shows the text, but is creating a new row on google sheets for every <p> element ...pieces of text on every row.
Is there a way to connect all the text inside all the <p> elements so at the end I just have one row with all the text on it?
Here is the source code:
<div class="article-body" itemprop="articleBody"> <p>Believe the buzz: <a href="/tvshows/the-people-v-o-j-simpson-american-crime-story/705835/"><em>The People v. O.J. Simpson: American Crime Story</em></a><em> i</em>s really good - like, edge-of-your-seat, a little bit outrageously good.</p> <p><strong>1. It's still an emotionally loaded story, 25 years later. </strong>While shooting the series, <a href="/celebrities/cuba-gooding-jr/213507/">Cuba Gooding Jr.</a>, who plays O.J. Simpson, was reunited with John Singleton, who not only directs an episode but is the only one among them who'd met and talked with O.J. "The first time I worked with ing."</p> <p><em>American Crime Story: The People v. O.J. Simpson</em> premieres Tuesday, Feb. 2 at 10/9c on FX.</p> </div> <div class="article-body" itemprop="articleBody"> ::before <p>...</p> <p>...</p> <p>...</p> <p>...</p> <p data-section="sharethrough"></p> <div data-placement="articles.show.sharethrough.inline" id="native_top" class="ad-dfp"></div> <p>...</p> <p>...</p> <p>...</p> <p>...</p> ::after </div> I appreciate any help on this, thank you!.
No comments:
Post a Comment