Automate firefox with python?
Solution 1
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.
Solution 2
You could try selenium.
Solution 3
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.
Solution 4
See if twill can help you. It can be used as a command line tool or as a python library.
Solution 5
I would suggest you to use Selenium instead of Mechanize/Twill because Mechanize would fail while handling Javascript.
RyanBrady
I solve problems and write code, but not necessarily in that order all of the time. I prefer to work with open standards, open source and open minds when available.
Updated on July 31, 2022Comments
-
RyanBrady almost 2 years
Been scouring the net for something like firewatir but for python. I'm trying to automate firefox on linux. Any suggestions?
-
legesh almost 15 yearsDo I still need Java for Selenium Server running?
-
RyanBrady almost 15 yearsmechanize ended up giving me the most functionality...thx
-
Łukasz almost 15 yearsYes, as Selenium is written in Java.
-
Rick over 13 yearsjust came across this and have to say that PyXPCOM looks really old and dusty, so to speak, its at least as old as 2001 and its hard to find much about how to use it, mechanize is ok but has some limitations like not able to handle javascript and also no way to automatically download normal things that are downloaded by a browser on page load (such as css, images, etc)
-
Rick over 13 yearsI don't think javascript would be appropriate for this it can't really compare to python for doing automation, etc but I suppose if you absolutely had to you could have javascript interact with your python script
-
Everett Toews about 13 yearsLink to PyXPCOM add-on is broken.
-
antiplex over 10 yearslooked nice but sadly development seems to have stopped as the last version is older than your post.