Closed jakejackson1 closed 1 year ago
Hi. Any response?
Sorry, I started to write a comment and then never finished.
Can you give me some markup so that I can understand better? I am guessing that what you are asking for may be a multi-step process with the current QueryPath. Something like qp('div.a')->text(qp('div.b')->text())
Hi Matt,
Your time is always valuable for me. Infect, I have been already waiting a lot for your answer since that day, now good to see your answer on it. Really thanks for doing this. :) :+1:
Well, actually I'm trying to read or write the outer HTML text of element.
Suppose I have this code like:
<div> <div>Hello World</div> </div>
If I use innerHtml() method. It will return me this code <div>Hello World</div>
.
But when I try get outerHtml by using this method outerHtml(). It should return complete html to me like this <div> <div>Hello World</div> </div>
. But unfortunately I could not find way to get outerHtml of any element in QP.
More, I also want to replace the outer text of any element.
Element A)
<div> <div> Hello World </div> </div>
I want this Output)
<section> <div> Hello World </div> </section>
Can you please help me on it?
Thanks for your time again.
@cognifloyd Thanks for helping me. Sure. let me correct it and send back again.
@sirsmac you're html markup didn't come through. Try editing your post and putting it in three backticks:
See https://guides.github.com/features/mastering-markdown/#examples for more on how to format your posts including several examples on how to format code.
Ah, yes... this is something that would be very nice to do easily. Right now, the "best" way is to...
That's a huge pain. If anyone feels like writing a method to do that, I'd certainly merge that pull request.
@technosophos I have fixed the html markup problem. Please check. @cognifloyd Thanks for helping me. Next time I will do it in same way.
From querypath created by imsaeedafzal: technosophos/querypath#158
I could not find the method to replace text with outerText of any element. For example, I want to replace Div A source with Div B.
Div A:
Div B:
Expected Out:
Can you please help me on it that how I can replace outertext? It's really creating a lot problem for me.
Thanks in advance!