Randomly auto click on link with javascript

Are it is possible to make a javascript to auto click on randomly link if visitor come from a specific website or website all page like google,com or google,com/search _result or any blog,com or blog,com/anypage