I wonder if the code below is what you want.
document.querySelector('.friendButton.addFriend a').click()
You'd better provide a link to one of the pages on which you want your script executed, so that I can make sure the script will work as expected.