如何解决Splash:使用pcall处理错误的请求HTTP 400
我写了一个小的Lua脚本来填写并提交 private Bitmap invert(Bitmap src) {
int height = src.getHeight();
int width = src.getWidth();
Bitmap bitmap = Bitmap.createBitmap(width,height,src.getConfig());
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
ColorMatrix matrixGrayscale = new ColorMatrix();
matrixGrayscale.setSaturation(0);
ColorMatrix matrixInvert = new ColorMatrix();
matrixInvert.set(new float[]
{
-1.0f,0.0f,255.0f,-1.0f,1.0f,0.0f
});
matrixInvert.preConcat(matrixGrayscale);
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrixInvert);
paint.setColorFilter(filter);
canvas.drawBitmap(src,paint);
// src.recycle();
return bitmap;
}
的登录表单。可悲的是它总是能实现
execute_lua(splash_obj,call_function)中的错误:错误的请求(HTTP 400)。
我在R中尝试了以下内容
splashr
始终以以下方式回复:
execute_lua(。,str_c(“函数main(splash)\ n assert(splash:go(”,: 错误的请求(HTTP 400)。
当我这样做时:
splash_local %>%
execute_lua(str_c('function main(splash)
assert(splash:go(',url,'))
assert(splash:wait(5))
local form = splash:select(',form,')
assert(form:fill({ email=',email,',password=',pass,remember_me=true }))
assert(form:submit())
end
pcall(main then print(debug.traceback()))')%>% gsub(pattern ='\\n',replacement =''))
在localhost:8050(启动容器的浏览器)我收到了:
飞溅响应:“”
如果功能正常运行,我相信可以提供。
有人可以告诉我飞溅的lua函数是否正确吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。