result=requests.get("https://www.google.co.in/searchq=ntest&oq=ntest&aqs=chrome..69i57j69i61j35i39l2j0l2.4898j0j7&sourceid=chrome&ie=UTF-8")
page=result.text
doc=soup(page,"html5lib")
a=doc.find_all('h3',{'class':'r'})
for i in a:
b=i.a
print(b.get('data-href'))
i dont know why it is unable to access the data-href attribute of anchor tag.