python
1import requests 2from bs4 import BeautifulSoup 3 4url='https://www… 5res=requests.get(url) 6res 7soup=BeautifulSoup(res.text,'html.parser') 8red=soup.find_all('span',attrs={'class':'red'}) 9red.text 10```とするとアトムランナーで以下のように帰ってきました 11 12Traceback (most recent call last): 13 File "C:\Users\Documents\test.py\python1.py", line 10, in <module> 14 red.text 15 File "C:\Users\AppData\Local\Programs\Python\Python310-32\lib\site-packages\bs4\element.py", line 2253, in __getattr__ 16 raise AttributeError( 17AttributeError: ResultSet object has no attribute 'text'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()? 18Running: python (cwd=C:\Users\Documents\test.py\python1.py pid=18380).. Exited with code=1 in 1.116 seconds. 19 20何が間違っているのでしょうか?