Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.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
如何等待工具栏出现在skribbl.io | Python中_Python_Python 3.x_Selenium_Selenium Webdriver_Selenium Chromedriver - Fatal编程技术网

如何等待工具栏出现在skribbl.io | Python中

如何等待工具栏出现在skribbl.io | Python中,python,python-3.x,selenium,selenium-webdriver,selenium-chromedriver,Python,Python 3.x,Selenium,Selenium Webdriver,Selenium Chromedriver,我正试图编写一个skribbl.io黑客程序。Skribblio是一个网站,在这里你画一些东西,人们不得不猜测你画了什么。我需要机器人在尝试绘制任何东西之前,等待绘图工具栏出现并可交互。我正在尝试使用此代码执行以下操作: Class Drawing: #some other code def response(self): try: self.wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, &

我正试图编写一个skribbl.io黑客程序。Skribblio是一个网站,在这里你画一些东西,人们不得不猜测你画了什么。我需要机器人在尝试绘制任何东西之前,等待绘图工具栏出现并可交互。我正在尝试使用此代码执行以下操作:

Class Drawing:
  #some other code


  def response(self):
    try:
      self.wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, ".containerToolbar[style]")))
    finally:
      return 'found'

D = Drawing()

while True:
  if D.response() == 'found':
    print('got good response')
    break
但是,我一进入赛前大厅,就会返回Find。游戏还没有开始,这个已经被归还了。可能值得一提的是,图形tooblbar在不可见时的外观如下:

<div class="containerToolbar" style="display: none;">

当它是可见的时,就像这样:

<div class="containerToolbar" style>


如果有人可以自己做一些研究,制作一个私人游戏并加入到另一个选项卡上,这将非常有帮助。

WebElement-Desired\u-element=driver.findElement(by.xpath(“您的xpath”);WebDriverWait wait=新的WebDriverWait(驱动程序,10);等待.直到(ExpectedConditions.element可单击/可见/启用(所需的元素));所需的_元素。单击您需要在python中尝试类似的事情