我正在尝试这样做,当你将url复制到剪贴板时,它会在链接中查找原始文本,然后自动将原始文本复制到剪贴板
我还需要它将此链接从https://pastebin.com/vwq1D1NA更改为https://pastebin.com/raw/vwq1D1NA,然后再从内部提取文本
例如,我想从这个pastebin链接中自动提取&;将文本“这是我要复制到剪贴板的文本”复制到我的剪贴板
复制链接>;在链接内搜索文本>;将链接内的文本复制到剪贴板
import requests
import pyperclip
url = 'https://pastebin.com/raw/'
r = requests.get(url)
content = r.text
pyperclip.copy(content)
pyperclip.paste()
print(content)
更新:
如果复制时只想将URL更改为Pastebin上的原始内容URL。试试这个:
试试这个。代码注释中的解释
我对贵项目要求的理解:
如果这不正确,请让我们知道
相关问题 更多 >
编程相关推荐