instruction
stringlengths
2
15
input
stringlengths
0
93
output
stringlengths
14
121
滚动网页至元素可见
await MR.Web.Element.scrollIntoView()
设置上传文件
'./demo.zip'
await MR.Web.Element.setInputFiles('./demo.zip')
获取元素坐标与长宽
const _ele_ml6o2r = await MR.Web.Element.box()
获取元素源码
const _ele_cldz56r = await MR.Web.Element.innerHTML()
获取元素文本(text)
const _ele_rbx5kr = await MR.Web.Element.innerText()
获取元素更多属性
'isEnabled'
const _ele_l0mose = await MR.Web.Element.property('isEnabled')
鼠标准备
await MR.Web.prepareMouse()
点击
0,0,{button: "left",clickCount: 1}
await MR.Web.Mouse.click(0,0,{button: "left",clickCount: 1})
双击
0,0,{button: "left",clickCount: 1}
await MR.Web.Mouse.dblclick(0,0,{button: "left",clickCount: 1})
移动(坐标)
0,0
await MR.Web.Mouse.move(0,0)
拖动(坐标)
0,0,100,100
await MR.Web.Mouse.drag(0,0,100,100)
按下键
await MR.Web.Mouse.down()
释放键
await MR.Web.Mouse.up()
键盘准备
await MR.Web.prepareKeyboard()
输入字符串
'Hello'
await MR.Web.Keyboard.type('Hello')
按键(包括组合键)
'CTRL+A'
await MR.Web.Keyboard.press('CTRL+A')
下载文件
'#selector'
const download = await MR.Web.download('#selector')
获取全部frame
const _frm_xu1dzk = await MR.Web.frames()
加载外部JS文件
{ path: './preload.js'}
const _ele_jvxz81 = await MR.Web.addInitScript({ path: './preload.js'})
对话框监听设置
async msg => { }
await MR.Web.onDialog(async msg => { })
控制台消息监听设置
async dialog => { }
await MR.Web.onConsole(async dialog => { })
读取文件(任意格式)
{_filename:'d:/demo.txt'}
const _file_80iw2bi = await MR.File.readFile({_filename:'d:/demo.txt'})
写数据至文件(任意格式)
{_filename:'d:/demo.txt',_data:''}
await MR.File.outputFile({_filename:'d:/demo.txt',_data:''})
读取Json文件
{_filename:'d:/demo.json'}
const _file_eemfh7 = await MR.File.readJson({_filename:'d:/demo.json'})
写入Json文件
{_filename:'d:/demo.json',_data:''}
await MR.File.outputJson({_filename:'d:/demo.json',_data:''})
复制文件/文件夹
{_srcFile:'d:/src.txt', _destFile:'d:/dest.txt'}
await MR.File.copy({_srcFile:'d:/src.txt', _destFile:'d:/dest.txt'})
移动文件/文件夹
{_srcFile:'d:/src.csv', _destFile:'d:/dest.csv'}
await MR.File.move({_srcFile:'d:/src.csv', _destFile:'d:/dest.csv'})
重命名文件/文件夹
{_oldFile:'d:/old.txt', _newFile:'d:/new.txt'}
await MR.File.rename({_oldFile:'d:/old.txt', _newFile:'d:/new.txt'})
清空文件夹
{_dir:'d:/src'}
await MR.File.emptyDir({_dir:'d:/src'})
删除文件/文件夹(包括子目录)
{_filename:'d:/demo/demo/demo'}
await MR.File.remove({_filename:'d:/demo/demo/demo'})
递归创建目录
{_dir:'d:/demo/demo/demo'}
await MR.File.mkdirp({_dir:'d:/demo/demo/demo'})
文件/文件夹是否存在
{_filename:'d:/demo.csv'}
const _file_l251omr = await MR.File.pathExists({_filename:'d:/demo.csv'})
判断是否为文件
{_filename:'d:/demo.csv'}
const _file_903tsz5 = await MR.File.isFile({_filename:'d:/demo.csv'})
获取文件和文件夹列表
{_dir:'d:/demo'}
const _file_771cqs = await MR.File.list({_dir:'d:/demo'})
获取文件列表
{_dir:'d:/demo'}
const _file_r43os0o = await MR.File.listFiles({_dir:'d:/demo'})
获取文件/文件夹大小
path=path
await MR.File.getsize(path=path)
读取INI文件
{_filename:'d:/demo.ini'}
const iniObj = await MR.Ini.readFile({_filename:'d:/demo.ini'})
保存INI文件
{_filename:'d:/demo2.ini',_iniobj:'iniObj'}
MR.Ini.writeFile({_filename:'d:/demo2.ini',_iniobj:'iniObj'})
读CSV文件并转Json对象
{_filename:'d:/demo.csv'}
const csvJson = MR.Csv.fileToJson({_filename:'d:/demo.csv'})
读Csv字符串转json对象
{_str:''}
const strJson = MR.Csv.strToJson({_str:''})
保存JSON数组至Csv文件
{_filename:'d:/demo.csv',_json:''}
MR.Csv.jsonToFile({_filename:'d:/demo.csv',_json:''})
字符串转换为Json对象
''
const _json_prtcbj = JSON.parse('')
JSON对象转换为字符串
''
const _json_ugbejav = JSON.stringify('')
读取文件为JSON对象
{_filename:'d:/demo.json'}
const _file_lnez5f = await MR.File.readJson({_filename:'d:/demo.json'})
Json对象保存到文件
{_filename:'d:/demo.json',_data:''}
await MR.File.outputJson({_filename:'d:/demo.json',_data:''})
网络软硬件信息
const _net_7iv0c6g = await MR.Net.address()
Mac地址
const _mac = await MR.Net.mac()
IPV4
const _ip4 = await MR.Net.ip4()
IPV6
const _ip6 = await MR.Net.ip6()
默认网关
const gateway = await MR.Net.gateway()
网址联通性
{_url:'http://www.makwing.com'}
const _net_p41djtvu = await MR.Net.checkSite({_url:'http://www.makwing.com'})
Get请求
{_url:'https://api.github.com/users/github', _headers:{} }
let res = await MR.Http.get({_url:'https://api.github.com/users/github', _headers:{} })
Post请求
{_url:'https://httpbin.org/post', _body:{}, _headers:{} }
let res2 = await MR.Http.post({_url:'https://httpbin.org/post', _body:{}, _headers:{} })
下载文件
{_url:'https://www.makwing.com/images/logo-white.png', _filename:'d:/demo.png', _headers:{} }
await MR.Http.download({_url:'https://www.makwing.com/images/logo-white.png', _filename:'d:/demo.png', _headers:{} })
表单提交
{_url:'https://httpbin.org/post', _body:{}, _headers:{} }
let res3 = await MR.Http.form({_url:'https://httpbin.org/post', _body:{}, _headers:{} })
邮箱配置
MR.Smtp.config()
发送邮件
{_from:'',_to:'',_subject:'',_text:''}
MR.Smtp.send({_from:'',_to:'',_subject:'',_text:''})
接受一次邮件
MR.Smtp.receive()
获取FTP对象
const ftp = await MR.Ftp.get()
下载文件
{_ftp:ftp, _remotePath:'/demo/abc.csv', _localPath:'D:/demo/abc.csv'}
await MR.Ftp.download({_ftp:ftp, _remotePath:'/demo/abc.csv', _localPath:'D:/demo/abc.csv'})
上传文件
{_ftp:ftp, _remotePath:'/demo/abc.csv', _localPath:'D:/demo/abc.csv'}
await MR.Ftp.upload({_ftp:ftp, _remotePath:'/demo/abc.csv', _localPath:'D:/demo/abc.csv'})
删除文件
{_ftp:ftp, _remotePath:'/aaa/aaa.txt'}
await MR.Ftp.delete({_ftp:ftp, _remotePath:'/aaa/aaa.txt'})
清理Ftp对象
{_ftp:ftp}
await MR.Ftp.quit({_ftp:ftp})
配置数据库链接
MR.Db.config()
关闭数据库链接
await MR.Db.close()
SQL查询
{_table: 'demo_table'}
const _dat_z3mg8t9 = await MR.Db.select({_table: 'demo_table'})
SQL插入
{ _table: 'demo_table', _data: {}}
const _dat_s3r5ngs = await MR.Db.insert({ _table: 'demo_table', _data: {}})
SQL更新
{_table: 'demo_table',_data: {},_where: 'id=1'}
const _dat_9zkj8w = await MR.Db.update({_table: 'demo_table',_data: {},_where: 'id=1'})
SQL删除
{_table: 'demo_table',_where: 'id=1'}
const _dat_r5e0a0m = await MR.Db.delete({_table: 'demo_table',_where: 'id=1'})
执行原生SQL
{_sql: 'select * from demo_table where id<10'}
const _dat_zi99zw8 = await MR.Db.raw({_sql: 'select * from demo_table where id<10'})
正则匹配
{_exp:'/*/g',_msg:''}
const _reg_ojavb28 = MR.Regex.match({_exp:'/*/g',_msg:''})
正则替换
{_exp:'/*/g',_msg:'',_text:''}
const _reg_c2d49q8 = MR.Regex.replace({_exp:'/*/g',_msg:'',_text:''})
获取校验对象
const validator = MR.Validator.get()
是否为Base64
''
const _val_yr0roa = MR.Validator.isBase64('')
是否为布尔值
''
const _val_9nwcy8u = MR.Validator.isBoolean('')
是否为哈希值
''
const _val_7dx8779 = MR.Validator.isHash('')
是否为日期
''
const _val_ku6qh7p = MR.Validator.isDate('')
是否为邮箱
''
const _val_yh5gzt8 = MR.Validator.isEmail('')
是否为空
''
const _val_bl74gb = MR.Validator.isEmpty('')
是否为浮点数
''
const _val_evyvjl = MR.Validator.isFloat('')
是否为全角值
''
const _val_mq0pzk = MR.Validator.isFullWidth('')
是否为半角值
''
const _val_1y2suaf = MR.Validator.isHalfWidth('')
是否为IP
''
const _val_funzyod = MR.Validator.isIP('')
是否为Json格式
''
const _val_ilk94tb = MR.Validator.isJSON('')
是否为JWT值
''
const _val_qonlq7j = MR.Validator.isJWT('')
是否为Mac地址
''
const _val_spdmd0t = MR.Validator.isMAC('')
是否为Md5值
''
const _val_7nlmbtt = MR.Validator.isMD5('')
是否为手机号码
''
const _val_ltpnyn = MR.Validator.isMobilePhone('')
是否为数值
''
const _val_07vir6 = MR.Validator.isNumeric('')
是否为强密码
''
const _val_pjm3ov = MR.Validator.isStrongPassword('')
是否为端口
''
const _val_cw41e9 = MR.Validator.isPort('')
是否为网址
''
const _val_8g4m8qy = MR.Validator.isURL('')
是否为大写
''
const _val_8ensthd = MR.Validator.isUppercase('')
验证码识别
{_filePath:'d:/yzm.png',_username:'', _password:'',_softId:'',_codeType:''}
const _http_6wxkwlg = await MR.Http.captcha({_filePath:'d:/yzm.png',_username:'', _password:'',_softId:'',_codeType:''})
获取html对象
html=html
htmlobj = rpa.parseHtml.getHtmlObj(html=html)
提取表格数据
html=html
htmlTable = rpa.parseHtml.getTables(html=html)
提取图片数据
html=html
htmlImg = rpa.parseHtml.getImages(html=html)
下载图片数据
html=html, picpath='C:/ImageDownload', picFormat='jpg'
rpa.parseHtml.downloadImg(html=html, picpath='C:/ImageDownload', picFormat='jpg')
锁屏
MR.System.lock()
解屏
{_username:'',_password:''}
MR.System.unlock({_username:'',_password:''})