Python PhantomJS,我无法输入数字

时间:2017-09-25 17:26:47

标签: python-3.x selenium phantomjs

我想向网站发送一个号码。但你不能这样做因为程序挂起了。代码:

input_code_user = input('Input code and press Enter:')
WebDriverWait(driver, timeout=10).until(lambda x: x.find_element_by_xpath("//label[@my-i18n='login_number_input_placeholder']")).click()
WebDriverWait(driver, timeout=10).until(lambda x: x.find_element_by_xpath("//input[@ng-model='credentials.phone_code']")).send_keys(input_code_user)

加载网站时,代码输入字段如下所示: When the site is loaded, the code entry field looks like this:

此表单的代码如下所示: The code for this form looks like this: 如果单击此字段,它将如下所示: If you click on this field, it will look like this: 在以前代码所在的同一个地方,它被替换为一个新代码: Code2 该程序依赖于此代码:

WebDriverWait(driver, timeout=10).until(lambda x: x.find_element_by_xpath("//input[@ng-model='credentials.phone_code']")).send_keys(input_code_user)

我试图在这行代码之后截取屏幕截图,但它没有创建。该计划有效,但没有任何反应。帮我找到解决方案。

0 个答案:

没有答案