Yes, a lawyer can sometimes represent you in court without your presence. For example, they may represent you in brief hearings to finalize the divorce where there’s a settlement agreement between the spouses.
However, your direct participation will require resolving such matters as property division, child custody, and support.