以前のバージョンのBeautifulSoup4の『nth-of-type(n)』では、問題なかったのですが、最近のBeautifulSoup4では、動作が不安定なようです。
(参考)https://d.aoikujira.com/bbs/mbbs.php?m=thread&threadid=19
そこで、『nth-of-type(n)』を使わず、select("li")のように書くと良いでしょう。
- [x] print(soup.select_one("li:nth-of-type(8)").string) #(1)
- [o] print(soup.select("li")[7].string) #(1)