Expert Problem for Solving Xpath -> Post URL

Hi to all my friends.

Today i need to check all price of a list of products from a website of one my competitor.
The problem is: website is in ASP, with search custom module, i mean i cant found the URL of searching... because when i search some products code, website redirect in

https://www.styl-moto.com/search/

The word for example i want search is: SMU0525

So with webanalyzer i see the parameter like this:

I do some experiment like This but didn work, someone can help me? very thanks i apprecciate.

=Dump(XPathOnUrl("https://www.styl-moto.com/search/";"//*[class=""prezzo_speciale""]";;HttpSettings(VERO;;;;"POST";"application/x-www-form-urlencoded";;{"page"\"1"."whr_search"\"products"."txt_search"\"SMU0525"});"text"))

Hi, this formula worked for me (dump is not necessary when requesting single value). Perhaps the Xpath is wrong, that seems to be the only thing that differs between our formulas.

=XPathOnUrl("https://www.styl-moto.com/search/";"//span[@class='prezzo_speciale']";;HttpSettings(;;;;"POST";"application/x-www-form-urlencoded";{"whr_search"\"products";"page"\"1";"txt_search"\"smu0525"});"text")

1 Like

You are a master!!! Very Thanks <3

1 Like

i want ask you something... if "SMU0525" its located in A2 how i add A2 inside Post parameter on formula directly?

i read something in this case solved by @nielsbosma
https://community.seotoolsforexcel.com/t/xpathonurl-with-cell-reference-for-post-parameter/111/6

So based at the resolution of @nielsbosma of the cases witch i linked in previus post. i tryed this with CHOOSE FORMULA but return me black cell

=XPathOnUrl("https://www.styl-moto.com/search/";"//span[@class='prezzo_speciale']";;HttpSettings(;;;;"POST";"application/x-www-form-urlencoded";CHOOSE({"page"\"1"."whr_search"\"products"."txt_search"\""};A2));"text")

Yeah this was trickier than I thought. Managed to get it working but ideally it should be possible to concatenate the original HttpSettings argument.

A1:
smu0525

B1:
="<HttpSettings><RequestMethod>POST</RequestMethod><RequestContentType>application/x-www-form-urlencoded</RequestContentType><RequestForm>" & "<Param Name=""whr_search"">products</Param><Param Name=""page"">1</Param><Param Name=""txt_search"">" & A1 & "</Param></RequestForm></HttpSettings>"

C1:
=XPathOnUrl("https://www.styl-moto.com/search/";"//span[@class='prezzo_speciale']";;B1;"text")

1 Like