执行以下命令时出现以下错误:

text = idobi Radio: New. Music. Unfiltered. idobi.com - a SHOUTcast.com member station
self.se.is_element_present("css=a[href]:contains('idobi Radio: New. Music. Unfiltered. idobi.com - a SHOUTcast.com member station')")


我正在网站上搜索的标题如下:

idobi Radio: New. Music. Unfiltered. idobi.com - a SHOUTcast.com member station


我得到的整个错误是:

 UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 91: ordinal not in range(128)


有人可以帮我解决这个问题吗?

谢谢。

最佳答案

硒本身是Unicode安全的。这可能是纯Python问题,而不是Selenium问题。

10-07 16:23