bs4.Comment.rindex

Comment.rindex(sub[, start[, end]]) → int

Like S.rfind() but raise ValueError when the substring is not found.