Is there a way of using API to send text to a textbox within a webpage??

For example if I want to log into eBay automatically. Would it be possible to find the hwnd of the username textbox and the password textbox then send the appropriate text to each, followed by clicking "sign in".

I have been stuck on this for ages, so please help me.

Thanks