https://i.imgur.com/IUPQ1Td.png
https://pastebin.com/V0gkJuwd
↑を実行すると

1件目のデータを取得中です
https://https://example.com/test/?p=1
regexp_20190922212309.txtに出力しました
2件目のデータを取得中です
https://https://example.com/test/?p=2
Traceback (most recent call last):
File "C:\Python\test.py", line 31, in <module>
html = html.fromstring(str(raw_html))
AttributeError: 'HtmlElement' object has no attribute 'fromstring'

↑1件目は問題なく動くのに2件目でAttributeErrorが出るのですがどうしてですか?