Extract Google Ads with Xpathonurl


#1

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.


#2

Can you provide a sample URL?


#3

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…


#4

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


#5

Can you try this XPath:

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


#6

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.


#7

Have you tried this method?


#8

thank you diskborste! that worked.