Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 幻影驱动程序don';在第页上看不到reactjs组件_Python_Selenium_Phantomjs - Fatal编程技术网

Python 幻影驱动程序don';在第页上看不到reactjs组件

Python 幻影驱动程序don';在第页上看不到reactjs组件,python,selenium,phantomjs,Python,Selenium,Phantomjs,我正试图从我的python脚本发送页面上的表单字段中的数据,这些字段在http服务器上工作。但当我尝试使用PhantomJS驱动程序运行脚本时,总是会出现以下错误: Unable to find element with id "x" 即使我在控制台中看到我的脚本已成功加载(绿灯)。但当我使用Chrome驱动程序时,一切都很好。我受审了 wait.until(EC.presence_of_element_located((By.ID, "RCPN"))) 但这给了我timeoutexcept

我正试图从我的python脚本发送页面上的表单字段中的数据,这些字段在http服务器上工作。但当我尝试使用PhantomJS驱动程序运行脚本时,总是会出现以下错误:

Unable to find element with id "x"
即使我在控制台中看到我的脚本已成功加载(绿灯)。但当我使用Chrome驱动程序时,一切都很好。我受审了

wait.until(EC.presence_of_element_located((By.ID, "RCPN")))
但这给了我timeoutexception错误。我当前的代码:

from random_data_generator import RandomDataGenerator
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.PhantomJS(
executable_path='c:\phantomjs\\bin\phantomjs.exe')
driver.get('http://someurl')

wait = WebDriverWait(driver, 5)
wait.until(EC.presence_of_element_located((By.ID, "blanks")))

driver.set_window_size(1024, 768)  # optional
recipient = RandomDataGenerator()
sender = RandomDataGenerator()

driver.save_screenshot('screen.png')  # save a screenshot to disk
rcpn_name = driver.find_element_by_id('RCPN')
rcpn.send_keys(recipient.get_name())
print rcpn_name
有什么问题吗