Python Selenium发送密钥警告大小 [英] Python Selenium Send Keys Giving Warning about size

查看:320
本文介绍了Python Selenium发送密钥警告大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过python硒绑定上传内容 element.send_keys(content),但出现内容大小错误.

I'm uploading content through python selenium binding element.send_keys(content), but I get a content size error.

我的数据将变得更大.

您能给我一个解决方案吗,我可以通过该解决方案将选定的元素分块追加,而不是将完整的和完整的数据放入要输入数据的选定字段中?

Can you please give me a solution through which I can append the selected element in chunks rather than putting the complete and entire data to my selected field where I want to enter data?

我的意思是我想将数据分块放置到选定的元素中,而不是将其放在单个操作中.

I mean I want to put data to the selected element in chunks rather than putting it in in a single action.

通过出现这种错误,似乎对我的系统和python也不利.

By getting this kind of error, seems not good for my system and python as well.

但是我不确定.只想知道这是真的吗?

But I'm not sure about it. Just want to know is it true?

请给我一个正确的主意,我如何才能通过send_keys分块发送数据.获得解决方案非常必要和需要.

Please give me the proper idea how can I send data through send_keys in chunks. It's very much necessary and needy to get its solution.

感谢您的帮助.

[1560:9968:1211/012355:ERROR:latency_info.cc(157)] RenderWidgetHostImpl::OnSwapC
ompositorFrame, LatencyInfo vector size 161 is too big.
[1560:9968:1211/012357:ERROR:latency_info.cc(157)] RenderWidgetHostImpl::OnSwapC
ompositorFrame, LatencyInfo vector size 419 is too big.
[1560:9968:1211/012402:ERROR:latency_info.cc(157)] RenderWidgetHostImpl::OnSwapC
ompositorFrame, LatencyInfo vector size 640 is too big.
[1560:9968:1211/012422:ERROR:latency_info.cc(157)] RenderWidgetHostImpl::OnSwapC
ompositorFrame, LatencyInfo vector size 169 is too big.
[1560:9968:1211/012424:ERROR:latency_info.cc(157)] RenderWidgetHostImpl::OnSwapC
ompositorFrame, LatencyInfo vector size 448 is too big.
[1560:9968:1211/012428:ERROR:latency_info.cc(157)] RenderWidgetHostImpl::OnSwapC
ompositorFrame, LatencyInfo vector size 557 is too big.

推荐答案

我知道我迟到了这个问题,但是最近遇到了这个问题.通过将用于SendKeys的字符串分成128个块并发送而不是整个字符串,我设法解决了这个问题.

I know I'm late to the question but I recently had this problem. I managed to work around the issue by chucking the string I'm using for SendKeys into 128 chunks and sending them instead of the whole string.

我正在使用C#,但是我确定您可以移植此代码,或者如果其他人遇到类似的问题.

I was working in C# but I'm sure you could port this code or if anyone else has a similar issue.

这是分块代码

static IEnumerable<string> ChunksUpto(string str, int maxChunkSize) {
    for (int i = 0; i < str.Length; i += maxChunkSize) 
        yield return str.Substring(i, Math.Min(maxChunkSize, str.Length-i));
}

取自将字符串分成一定大小的块

这篇关于Python Selenium发送密钥警告大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆