Write to professor or secretary?
If a professor has posted their email publicly online, then it is an invitation to contact them directly on technical matters.  In my experience, very few professors are unwilling to be contacted directly, and those who are unwilling typically clearly state who is the appropriate alternate contact person on their personal website (the institution may, of course, still list them in their directory).

You might not, however, get any reply.  Just because somebody is willing to be contacted doesn't mean they'll respond to everybody who does so.  If you don't get a response within a few days, then contact the secretary instead, and if you still don't get a response, then it is best to assume disinterest and move on.