Python Selenium未向输入字段发送波浪号字符(~)
我正在创建一个从excel工作表获取url的应用程序,但它的url中有一个波浪号“~”。当我使用selenium将该字符复制到输入字段时,它不会复制自身Python Selenium未向输入字段发送波浪号字符(~),python,excel,selenium,Python,Excel,Selenium,我正在创建一个从excel工作表获取url的应用程序,但它的url中有一个波浪号“~”。当我使用selenium将该字符复制到输入字段时,它不会复制自身 string url = "www.test~dummy.com"; foreach (string x in url.Split('~')) { element.SendKeys(x); element.SendKeys("\u223C"); } element.SendKeys(Keys.Backspace); //this
string url = "www.test~dummy.com";
foreach (string x in url.Split('~'))
{
element.SendKeys(x);
element.SendKeys("\u223C");
}
element.SendKeys(Keys.Backspace); //this is used to erase the wrong tilde typed at the end of the URL
我去年遇到过一个帖子,但没有人能解决这个问题。因此,希望有人知道答案:
提前谢谢
#Fill in Discription
driver.find_element_by_xpath('//[@id="description"]').send_keys(Description)
这是我们的朋友@Mithun Mandal在另一篇文章中所说的内容的一种表示,它是C语言的,考虑到它是selenium语言,转换成python应该不会太难
string url = "www.test~dummy.com";
foreach (string x in url.Split('~'))
{
element.SendKeys(x);
element.SendKeys("\u223C");
}
element.SendKeys(Keys.Backspace); //this is used to erase the wrong tilde typed at the end of the URL
在这里工作。这是我们的朋友@Mithun Mandal在另一篇博文中所说的,它是C语言,考虑到它是selenium语言,转换成python应该不会太难
string url = "www.test~dummy.com";
foreach (string x in url.Split('~'))
{
element.SendKeys(x);
element.SendKeys("\u223C");
}
element.SendKeys(Keys.Backspace); //this is used to erase the wrong tilde typed at the end of the URL
在这里工作。我用这种方法把它修好了 说明.替换“~”,“\u223C”
这对我来说很有用:我用这种方法把它修好了 说明.替换“~”,“\u223C”
这对我很有用:你说没有人能解决这个问题是什么意思?你试过答案了吗?你说没有人能解决这个问题是什么意思?你试过答案了吗?