What is the ruling regarding investing in an online fashion company?

Per the norm, these companies will have people modelling the clothes, sometimes in a immodest way.

If it is Haram, what are the rules regarding divesting from this?

Are there any books on the jurisprudence of Investing in English?

If this fashion company contributes to immorality (such as people immodestly displaying the clothes) and investing in this company directly supports this, then it would be Haram. However, if your investment in this company supports the other activities of this company and doesn’t directly support the immodest display of clothes, then it’s fine.

You may find several rulings here on work and investment:

https://www.sistani.org/english/book/46/

Also here:

https://www.al-islam.org/a-code-of-practice-for-muslims-in-the-west-ayatullah-sistani/work-investment

You may sell your shares and withdraw from the investment if it is deemed that it is haram.