Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controlling a browser using Python, on a Mac

I'm looking for a way to programatically control a browser on a Mac (i.e. Firefox or Safari or Chrome/-ium or Opera, but not IE) using Python.

The actions I need include following links, checking if elements exist in a page, and submitting forms.

Which solution would you recommend?

like image 966
GJ. Avatar asked Apr 18 '10 04:04

GJ.


People also ask

Can Python control a web browser?

In this article, we are going to see how to control the web browser with Python using selenium. Selenium is an open-source tool that automates web browsers. It provides a single interface that lets you write test scripts in programming languages like Ruby, Java, NodeJS, PHP, Perl, Python, and C#, etc.

How do I open a specific web browser in Python?

To open a page in a specific browser, use the webbrowser. get() function to specify a particular browser.

How do you use Python commands on a Mac?

On a Mac system, it is very straight-forward. All you need to do is open Launchpad and search for Terminal , and in the terminal, type Python and boom, it will give you an output with the Python version.


1 Answers

I like Selenium, it's scriptable through Python. The Selenium IDE only runs in Firefox, but Selenium RC supports multiple browsers.

like image 50
digitaldreamer Avatar answered Sep 22 '22 15:09

digitaldreamer