WebElement.getText()函数和utf8 [英] WebElement.getText() function and utf8

查看:47
本文介绍了WebElement.getText()函数和utf8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以假设对于每个网页, WebElement.getText()函数的确会返回utf8字符串,或者它可以具有其他编码吗?

May i assume that for every web page the WebElement.getText() function does return utf8 Strings, or can it have other encodings?

如果还有其他编码,如何识别并将其转换为utf8?

If there could be other encodings, how can i identify it and convert it to utf8?

推荐答案

我不知道有没有一种好方法(也许如果您喜欢反射,可以修改并重写)来执行getText()返回所需的编码.但是在这个 Selenium Web驱动程序和多语言我写了一些编码String的方法.

I don't know no one good way(maybe if you like reflection, you can hack and rewrite) to do getText() return needed encoding. But in this Selenium web driver and multillanguage I wrote some way to encode String.

这篇关于WebElement.getText()函数和utf8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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