I am trying to write a script that makes it possible to change the url of an active process.

我正在尝试编写一个脚本,可以更改活动进程的URL。

So for instance, I am starting my browser using:

例如,我正在使用以下命令启动浏览器:

browser = Popen(["chromium", "http://www.google.com"])

After an X interval I want to change the url of browser.

在X间隔后,我想更改浏览器的URL。

I've tried allot of things to get this result but nothing has succeeded so far. (stdin.write / put (PIPE) etc etc.).

我已经尝试了很多东西来获得这个结果,但到目前为止还没有任何成功。 (stdin.write / put(PIPE)等等)。

browser = sh.Command('uzbl-browser')(print_events=True, config='-', uri=current_browser_url, _bg=True)
browser.process.stdin.put('uri http://www.google.nl' + '\n')

I'm hoping you can help me out with this.

我希望你能帮我解决这个问题。

Regards,

Wesley.

4 个解决方案

#1


if you work with browsers + python, you'll probably want to take a look at Selenium. It's not copy-paste but you can learn it in couple of hours...

如果你使用browser + python,你可能想看看Selenium。这不是复制粘贴,但你可以在几个小时内学习它...

http://www.seleniumhq.org/

更多相关文章

  1. 第五十九节,模拟浏览器请求Python结合html基本格式
  2. 从QQ浏览器缓存文件中提取出完整的视频
  3. (转载)浏览器兼容性问题大汇总
  4. Android中轴旋转特效实现,制作别样的图片浏览器
  5. 关于selenium android下的浏览器测试
  6. js 区分浏览器来源是PC端还是移动端
  7. JS唤醒Android APP(包括在外部浏览器和WebView)
  8. javascript(六)js事件绑定浏览器兼容解决方案 attachEvent addEve
  9. 在Java中,使用DefaultSelenium对象在selenium中启动测试,我如何找

随机推荐

  1. android studio 模拟器出现中文乱码解决
  2. Android遇到 android studio "Internal H
  3. Android 2.2 Platform
  4. 在编译Android时,开机不锁屏
  5. android 短信是否发送成功
  6. Android   收集索引贴
  7. Android电话秀(二)
  8. Android计算缓存大小、清空缓存
  9. Android取消EditText自动获取焦点
  10. Android开发中Android与网页(JavaScrip)t的