Automate firefox with python? [closed]

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


Asked by: Sawyer303 | Posted: 28-01-2022






Answer 1

You could try selenium.

Answered by: Freddie476 | Posted: 01-03-2022



Answer 2

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.

Answered by: Marcus861 | Posted: 01-03-2022



Answer 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.

Answered by: Roland211 | Posted: 01-03-2022



Answer 4

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

Answered by: Roman592 | Posted: 01-03-2022



Answer 5

I would suggest you to use Selenium instead of Mechanize/Twill because Mechanize would fail while handling Javascript.

Answered by: Richard810 | Posted: 01-03-2022



Answer 6

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

Answered by: Dominik297 | Posted: 01-03-2022



Answer 7

Install Mozlab in Firefox and enable the telnet server, then open a socket.

Answered by: Julian900 | Posted: 01-03-2022



Answer 8

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.

Answered by: Sawyer801 | Posted: 01-03-2022



Similar questions

c# - Automate SSH login under windows

I want to be able to execute openssh with some custom arguments and then be able to automatically login to the server. I want that my script will enter the password if needed and inject 'yes' if I'm prompted to add the fingerprint to the known hosts. I've found SharpSsh for C# that do that, but I also need to use -D parameter and use ProxyCommand that I define in SSH, and the library is quite lacking for that usag...


python - How to automate updating a trac wiki page?

I have a trac wiki page I'd like to update automatically on a regular basis (say, once an hour) with data fetched by a script. I can get the script to generate the wiki markup. How would you then upload that to the trac page? I want to replace the whole body of the page. I would prefer a solution in python, as the rest of the stack (trac, fetching scripts) also use that. Just a pointer in the right ...


Automate file download from http using python

I want to automatically save a file from a website. I don't know how to bypass the Download File prompt in python and save it directly to my c: drive. Any help is appreciated, Elliott


macos - Automate 'enter' key in Python (on a Mac)

I'm creating test automation for an application. I am using a testing tool to do most of the testing, but in order to get to that point I first need to automate one 'enter' key click in Python. I am using a mac, so pywin32 is not available. Any suggestions?


python - Using php curl to automate website.

This question already has answers here:


qt4 - writing python script to automate QGIS (Qt) tasks

I am using QGIS to do some repetitive mapping work. I have a floor plan of an elderly home which is digitized into QGIS with the bed numbers properly labeled, and a spreadsheet with the bed numbers and all the other attributes that belong to that bed. I need to create multiple layers and visualize them one by one, currently I am using the 'save as image' function. It's OK if I only need to work on it once however I...


Python and Bash: how to automate user input?

I downloaded some scripts in both python and bash that prompt the user for command line input. Since I run these scripts often, I would like to automatically supply the input to the programs. I prefer not to modify the scripts. Is there a way to do it without modifying the original code? [UPDATE] thanks to EnabrenTane's advice, it seems to work pretty well, until I got to a line that read ...


Using Python and pywin32 to automate data entry

I'm trying to write a python script that will take data and enter it into any form, Here's my code so far: def pasteNum(n): win32clipboard.OpenClipboard() win32clipboard.EmptyClipboard() win32clipboard.SetClipboardData(win32con.CF_TEXT, str(n)) ##CTRL-A win32api.keybd_event(win32con.VK_LCONTROL,0x1d, 0, 0) win32api.keybd_event(win32api.VkKeyScan('A'),0x1e, 0, 0) win32api.keyb...


How to automate UI using python, pls any can share example

I have a web application I need to automate UI design Using python script


python - MySQL: Automate this chain of queries (new columns from values)

I have a table that contains data which looks like this: date met val 2012-10-18 avgt 63.3617 2012-10-16 avgt 65.7312 2012-10-19 avgt 66.4952 2012-10-17 avgt 67.3747 2012-10-18 cdd 53.3617 2012-10-17 cdd 55.3472 2012-10-19 cdd 66.8063 2012-10-16 cdd 67.3116 2012-10-18 maxt 43.3617 2012-10-19 maxt 47.4484 2012-10-16 maxt 65...






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top