dongyanghan0556 2013-01-11 03:29
浏览 73
已采纳

Selenium 2和Firefox配置文件未应用

So i'm stuck, I'm running my script through a proxy which requires HTTP Authentication, however I can't authenticate with @:.. So I decided to create a profile that has the authentication plugin added for FireFox and make it auto input.

I've made the zip base64 file, as I'm running on OSX I used the following commands,

zip -r profile 3rkomsuo.selenium

openssl base64 -in "profile.zip" -out "profile.zip.b64"

The file is 24MBs tho(edit, disabled firebug and now it's only about 4MB, still no luck)? I only added 2 plugins, firebug and Auth plugin, that's tiny! Now I've put the file into my web directory, I'm running MAMP, and I send the profile as described.

$session = $web_driver->session('firefox', array("firefox_profile" => file_get_contents("profile.zip.b64"))); 

I've checked the POST, send a correct array, i've increased PHP POST size in php.ini to 64MBs just in case, however nothing works, still loads the basic(nothing set up) profile? If anyone could help you would be my hero as I've spent several hours debugging this without any luck!

  • 写回答

2条回答 默认 最新

  • duanmu5039 2013-01-12 08:15
    关注

    Managed to set up the profile, make sure you rename prefs.js to user.js and zip the folder contents for the profile, not the profile folder itself!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Stata链式中介效应代码修改
  • ¥15 latex投稿显示click download
  • ¥15 请问读取环境变量文件失败是什么原因?
  • ¥15 在若依框架下实现人脸识别
  • ¥15 网络科学导论,网络控制
  • ¥100 安卓tv程序连接SQLSERVER2008问题
  • ¥15 利用Sentinel-2和Landsat8做一个水库的长时序NDVI的对比,为什么Snetinel-2计算的结果最小值特别小,而Lansat8就很平均
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错