Automate firefox with python?

2019-01-23 17:13发布

Been scouring the net for something like firewatir but for python. I'm trying to automate firefox on linux. Any suggestions?

8条回答
时光不老,我们不散
2楼-- · 2019-01-23 17:26

The languages of choice of Firefox is Javascript. Unless you have a specific requirement that requires Python, I would advice you to use that.

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2019-01-23 17:29

I use Selenium RC. All my tests are written in Python and are run with test suite.

One minor thing is that You either have to start selenium manually and point Your tests to it or start selenium from test suite which requires little bit of coding. But it's doable.

Generally I'm very pleased with this solution.

查看更多
混吃等死
4楼-- · 2019-01-23 17:32

You could try selenium.

查看更多
神经病院院长
5楼-- · 2019-01-23 17:32

See if twill can help you. It can be used as a command line tool or as a python library.

查看更多
倾城 Initia
6楼-- · 2019-01-23 17:36

The PyXPCOM extension is one possibility.

But looking at what firewatir provides, I have to 2nd the suggestion for twill. It's based on mechanize, which might also be useful in this context.

查看更多
我命由我不由天
7楼-- · 2019-01-23 17:37

Many command line tools don't have a javascript interpreter so do not support web 2.0 functionality. juicedpyshell is based on PyXPCOMext's PyShell example. It gives you a python shell window "inside" the browser, and simplifies access to both the DOM of what you are browsing to and also the shell window itself (so you can add GUI elements as part of your automation script). But its a new project so probably not as full featured as some of the above.

查看更多
登录 后发表回答