All perfect praise be to Allah, The Lord of the Worlds. I testify that none is worthy of worship except Allah and that Muhammad is His slave and messenger.
In principle, the worldly sciences, just like other sciences, should learnt from a teacher (whether physically attending or online). In some fields, learning worldly sciences without a teacher could result in harming people. For example, if one learns engineering without a teacher and then builds a house, it could collapse on its inhabitants because he did not master engineering since and used the wrong method to obtain this knowledge. Likewise, if one learns medicine without a teacher, he can easily make a mistake in prescribing the medicine to patients, and thus harm people.
However, there are some worldly sciences which one can study without a teacher and no harm would result from that, such as programming, web design and so on; there is no harm if one learns such sciences on his/her own without a teacher.
For more benefit, please refer to Fatwa 166265.
Allah Knows best.