打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
【影刀RPA】如何让影刀操作谷歌多用户 实现多店铺切换

视频教程

https://www.bilibili.com/video/BV1kh411L7fJ/?spm_id_from=333.999.0.0

要实现切换谷歌浏览器要获取快捷方式的属性 具体可以看视频教程

要获取谷歌 Chrome 快捷方式的属性,您需要使用 Python 的 oswinshell 库。请注意,这只适用于 Windows 操作系统。首先,您需要安装 winshell 库。在命令提示符或终端中运行以下命令安装它:

pip install winshell

接下来,使用以下 Python 代码来获取 Chrome 快捷方式的属性:

import os
import winshell

# 为了方便起见,这里假设 Chrome 快捷方式位于桌面上。您可以根据需要调整文件路径。
desktop = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop')
chrome_shortcut = os.path.join(desktop, 'Google Chrome.lnk')

# 读取快捷方式属性
shortcut = winshell.shortcut(chrome_shortcut)

# 获取属性值
target = shortcut.path # 目标路径
arguments = shortcut.arguments # 命令行参数
working_dir = shortcut.working_directory # 工作目录
icon_location = shortcut.icon_location # 图标位置
hotkey = shortcut.hotkey # 快捷键
description = shortcut.description # 描述

# 输出结果
print("Target:", target)
print("Arguments:", arguments)
print("Working Directory:", working_dir)
print("Icon Location:", icon_location)
print("Hotkey:", hotkey)
print("Description:", description)

这段代码将获取 Google Chrome 快捷方式(这里假设它位于桌面上)的所有属性值并将其输出到控制台。如果您想要处理其他快捷方式,请确保正确设置 chrome_shortcut 变量的值。

影刀代码

# 使用提醒:
# 1. xbot包提供软件自动化、数据表格、Excel、日志、AI等功能
# 2. package包提供访问当前应用数据的功能,如获取元素、访问全局变量、获取资源文件等功能
# 3. 当此模块作为流程独立运行时执行main函数
# 4. 可视化流程中可以通过"调用模块"的指令使用此模块

import xbot
from xbot import print, sleep
from .import package
from .package import variables as glv

def main(args):
pass
import os
import winshell

# 为了方便起见,这里假设 Chrome 快捷方式位于桌面上。您可以根据需要调整文件路径。
# desktop = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop')
# chrome_shortcut = os.path.join(desktop, 'Google Chrome.lnk')
def test(chrome_shortcut):

# 读取快捷方式属性
shortcut = winshell.shortcut(chrome_shortcut)

# 获取属性值
target = shortcut.path # 目标路径
arguments = shortcut.arguments # 命令行参数
working_dir = shortcut.working_directory # 工作目录
icon_location = shortcut.icon_location # 图标位置
hotkey = shortcut.hotkey # 快捷键
description = shortcut.description # 描述

return arguments

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
简单易用,用Powershell劫持Windows系统快捷键;含POC
[技巧]史上最折腾的 Win+R
delphi 恶意修改快捷方式
如何将网站添加到您的Android主屏幕
用User-Agent伪装你的浏览器(IE,Chrome,Firefox ),巧妙打开微信网页方法
解决hao123胁持chrome主页问题 | FromHJ's blog
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服