Can We Get The Corresponding HTML As Well When Using XPathOnURL?

#1

I understand that I can fetch the textual contents of an XPath, as well as a URL by appending "href" when using that formula. But is there a way to retain all the corresponding HTML as well? In other words, let's say a standard XpathOnURL formula returned the following:

The quick brown fox jumps over the lazy dog

I would instead like to fetch all the HTML associated with it as well, such as:

<a href="foo">The <b>quick brown fox</b> jumps over the lazy dog</a>

I'm aware of the HTMLFirst function, but I would like to target a specific section of the code with something like an XPath as well. Is this possible?

#2

There's no support for returning HTML with XpathOnURL. Only returns text nodes.

You can request this feature on http://seotools.uservoice.com/forums/134457-seotools

You might be able to do what you want with a regexp?

#3

Thanks! I will put in a request.

#4

A fix for this will be included in the next release.

=Dump(XPathOnUrl("http://seotoolsforexcel.com";"//a";;;"html"))
#5

Very cool, thank you!

#6

@nielsbosma thanks for going back and updating this comment. It's exactly what I was looking for!