Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编写一个 24/7 运行的机器人来检查 Instagram 上某些帐户的新帖子。我发现对我来说最好的刮板是instagram-scraper,但它只在 cmd 中运行并将图像下载到我计算机上的文件中。所以我需要一个可以运行 cmd 命令、创建和使用文件来存储图像的在线服务器。
instagram-scraper
我找到了网站replit.com,它在云中提供设置机器人。
我什至不知道从哪里开始搜索如何使用 cmd、文件和replit.com上的所有内容。我应该怎么办?
要使用对 repli 或 pythonanywhere 等服务具有文件夹访问权限的机器人,您可能希望从工作区的路径开始。__ROOTFOLDER__ = os.path.dirname(os.path.abspath(__file__))将为您提供当前的工作目录,您可以提供或使用工作区中的数据。
__ROOTFOLDER__ = os.path.dirname(os.path.abspath(__file__))
对于 CMD 部分,您可以通过os库调用命令行。请记住,CMD 有字符限制。
os
os.system('YOUR LINE HERE')