【问题标题】:Using selenium in firefox在 Firefox 中使用硒
【发布时间】:2012-08-29 20:31:45
【问题描述】:

您好,我想在下载弹出窗口上单击“确定”,但是当我尝试时

drive = selenium.selenium.selenium()
drive.choose_ok_on_next_confirmation()

它给了我一个错误AttributeError: type object 'selenium' has no attribute 'selenium'。我已经尝试为首选项设置 MIME 类型,但它不起作用。

【问题讨论】:

  • 那么它在哪一行失败了?如果它在drive = selenium.selenium.selenium() 上失败,那么我会假设你有一对多selenium...
  • 但是如果我这样做selenium.selenium 它仍然不存在。
  • 你用的是webdriver还是RC?

标签: python firefox selenium


【解决方案1】:

你是如何导入 selenium 模块的?

通过 google 快速搜索找到此页面:Selenium RC with Python in 30 seconds。该页面底部的代码是如何启动和运行 selenium 实例的最小示例。

【讨论】:

    【解决方案2】:

    目前尚不清楚您在这里使用的是什么,但假设您只是使用 selenium 遥控器,您应该能够做到

    from selenium import selenium
    

    紧随其后

    sel = selenium("localhost", 4444, "firefox", "http://www.google.com")
    

    或类似的东西。你真的应该仔细看看documentation

    【讨论】:

      猜你喜欢
      • 2021-08-04
      • 1970-01-01
      • 2017-01-16
      • 2021-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-11
      • 1970-01-01
      相关资源
      最近更新 更多