Extract Google Ads with Xpathonurl

Can someone help me extra all google ads for particular keywords in SERP? I'm getting blanks with the formula below

=dump(XPathOnUrl("https://www.google.co.jp/#safe=active&q=keyword","//div[@class='ads-visurl']/cite[@class='_WGk']"))

I only need the URL of the ad. Thank you in advance.

Can you provide a sample URL?

I think the problem is that Excel is getting another page than you see in browser. And if you try to scrape another language mutations, you can be redirected. Try to get whole source code from Excel and look what you really get instead of reading in browser and trying to write directly to Excel. Remember Excel has another set of cookies aso...

i think google serves ads based on location so this url may or may not have ads. but it should since it's a "region free" keyword. hopefully you can see 4 ads at the top. thank you in advance, diskborste.

https://www.google.com/search?q=cheap+hotels&ie=utf-8&oe=utf-8&client=firefox-b&gws_rd=cr&ei=uIEAWdjONIut8QXZzZxA&fg=1

Can you try this XPath:

=Dump(XPathOnUrl(A1;"//div[@class='ads-visurl']/cite"))

thank you diskborste. it works but only when the keyword is in the url. in other words, i can't use a cell reference as the keyword.

Have you tried this method?

thank you diskborste! that worked.