因此,为在discord.py中嵌入的图像设置图像时,语法为
embed.set_image(url='http://url_to_image')
Run Code Online (Sandbox Code Playgroud)
但是我的问题是我不知道如何将其设置为本地保存的图像,因此我不必一直保持与这些URL的连接。
谢谢。
(链接到文档:http : //discordpy.readthedocs.io/en/latest/api.html#discord.Embed.set_image)
我正在尝试了解我使用 Python 进行网络抓取的方法。我目前正在尝试将字符串输入网站上的文本框(我正在使用https://test4python.sarahah.com/)
所以我找到了使用此代码的文本框:
from bs4 import BeautifulSoup
from requests import get
r = get('https://test4python.sarahah.com/')
soup = BeautifulSoup(r.content)
findtextbox = soup.find('textarea',id='Text')
Run Code Online (Sandbox Code Playgroud)
但是现在我已经这样做了,我很难理解我是如何输入字符串的。感谢您的帮助。