I want to get the urls from google results.
This xpath works perfectly BUT there is a problem:
//div[@class='r']/a
Google shows some results from featured snippets and People Also Ask (https://www.google.com/search?q=people+also+ask+example) and that xpath gets all those url results.
I realized there is a parent div with "g" class, and only the People Also Ask div has the class "kno-kp".
So the solution is easy:
Select every div class that contains "g" and not contains "kno-kp"
This is my xpath but it doesn't work:
//div[contains(@class,'g') and not(contains(@class,'kno-kp'))]//div[@class='r']/a
Thank you for your help!