@client.command()
async def csgonow(ctx):
url = "https://steamdb.info/app/730/graphs/"
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
soupObject = BeautifulSoup(await response.text(), "html.parser")
online = soupObject.find(class_='home-stats').find('li').find('strong').get_text()
await ctx.send(online + ' players are playing this game at the moment')
当我使用命令!R csgonow
时,我得到以下错误:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception:
AttributeError: 'NoneType' object has no attribute 'find'
我该如何解决这个问题
您可以使用CSS选择器:
相关问题 更多 >
编程相关推荐