小编hac*_*jay的帖子

python selenium webdriver问题(selenium.common.exceptions.WebDriverException:消息:"无法加载配置文件.配置文件目录:)

我正在使用Mac OS X 10.8.3,selenium 2.32.0,python 2.7,Firefox Version 20并且在运行python绑定时遇到此错误:

selenium.common.exceptions.WebDriverException: 
    Message: "Can't load the profile. Profile Dir: /var/folders/vn/8h6w79td4p59l9h9xhx2986r0000gn/T/tmpTmsdul Firefox output:  LOG addons.xpi: startup
    LOG addons.xpi: Skipping unavailable install location app-system-share
    LOG addons.xpi: checkForChanges
    LOG addons.xpi: No changes found
    2013-04-11 21:59:09.107 firefox-bin[26167:707] invalid drawable"
Run Code Online (Sandbox Code Playgroud)

Firefox打开,但不加载我在python selenium脚本中提供的url.我已经看到很多其他人都喜欢这个帖子:

从stackoverflow发布

但我已经跟踪到了我在localhost上运行本地开发站点这一事实.在我的主机文件中,我设置了它:

127.0.0.1 local.development.com
Run Code Online (Sandbox Code Playgroud)

当我把它改回原来:

127.0.0.1 localhost
Run Code Online (Sandbox Code Playgroud)

一切都很好.现在,只需编辑我的主机文件即可在本地开发站点和selenium之间切换.但是想问一下我是否有办法让我的本地开发站点保持运行并且仍然同时使用selenium.

任何建议或细节.也许对内部运作有一些解释,拜托?提前致谢.

python selenium webdriver localhost

5
推荐指数
1
解决办法
3514
查看次数

Python selenium webdriver点击功能

有谁知道你如何使用python webdriver绑定点击基于href的链接.在waitr-webdriver你可以做这样的事情:

browser.link(:href => "http://www.testsite.com/pageOne.html").click
Run Code Online (Sandbox Code Playgroud)

但我无法在python webdriver中找到类似的功能.一切都有

find_element_by_class_name
find_element_by_css_selector
find_element_by_id
find_element_by_link_text
find_element_by_name
find_element_by_partial_link_text
find_element_by_tag_name
find_element_by_xpath

这些都是很好的方法,但我测试的网站在其链接中没有ID或类.因此,关于链接的唯一独特之处是href url.

任何帮助将不胜感激.

python selenium webdriver click

4
推荐指数
1
解决办法
6735
查看次数

标签 统计

python ×2

selenium ×2

webdriver ×2

click ×1

localhost ×1