ok
button(what i got XPath from) will only be there first time visits Yahoo,then cookies get saved.So you will not see
ok
button it a browser where you have visit Yahoo before.As Selenium start a new session every time and have no saved cookies,
then have to push ok button every time.