.Replace () is causing the exception because authorElement.QuerySelector (…). InnerTextClean returns a null value. This is very rare (1 / 100,000), so I would prefer to use catch catch than check for null.
author.salescount = Convert.ToInt32 (authorElement.QuerySelector ("div.sale-info.is-hidden-phone> em"). InnerTextClean.Replace (",", ""));
So, my question is, do I have to divide this into many lines and just try to capture the individual function that fails?
.ToInt32 () obviously can not accept a null, but I guess the try catch block will throw the exception as soon as it happens. Then I could wrap the whole thing.
I guess I solved it, am I wrong and / or is there something I have not considered?