Xpathonurl with Cell Reference for POST Parameter

I'm using the following function:

=XPathOnUrl("http://www.website.com/SellPricing.php","//dl[@class='pay']/dd","",HttpSettings(TRUE,,,,"POST","application/x-www-form-urlencoded",{"ISBN","[A3]"}))

I reference cell A3 there, but it doesn't work, since it's in an array it doesn't seem to resolve the Cell reference, it takes A3 literally, I've tried adding more quotes using the typical " & A3 & " etc... but nothing I've tried seems to work.

Any recommendations?

EDIT: if I remove the quotations all together Excel says "We found a problem with this formula" and wont let me.

What happens if you try:

=XPathOnUrl("http://www.website.com/SellPricing.php","//dl[@class='pay']/dd","",HttpSettings(TRUE,,,,"POST","application/x-www-form-urlencoded",{"ISBN",A3}))

I get the "We found a problem with this formula" and excel wont accept it without quotation marks around the cell reference.

Anyone have any ideas?

Yes, so that won't work.

From: https://fastexcel.wordpress.com/2015/01/11/using-constant-arrays-and-array-expressions-in-excel-formulas/

Constant arrays are Excel formula expressions that allow you to create arrays containing numbers, text, logical values or error values.

So that sucks. Found another solution using the CHOOSE function that allows for creating array expressions using references:

Try this:

=XPathOnUrl("http://www.website.com/SellPricing.php","//dl[@class='pay']/dd","",HttpSettings(TRUE,,,,"POST","application/x-www-form-urlencoded",CHOOSE({1,2},"ISBN",A3)))

1 Like

Holy Crap that worked!

Thank you SO much, I spent so much time trying to figure this out and got no where, that worked perfectly :slight_smile:

BTW. I recommend that you take a look a converting this into a [connector][http://seotoolsforexcel.com/connectors/] instead. I'd be happy to show you how if you share the url and a sample ISBN (I'm guessing website.com isn't the page?).