[Tutor] Can Python monitor web browser content

Alan Gauld alan.gauld at btinternet.com
Fri Jan 25 20:54:47 CET 2013


On 25/01/13 17:52, 3n2 Solutions wrote:

> I was wondering if Python can monitor web browser content.

Browsers just display html text and Python can read html so
yes you can do it by getting your program to emulate a browser.

Look at the standard library modules urllibm htmllib and htmlParser.
Or for more adventurous parsing try the external module BeautifulSoup, 
it tends to handle badly formed html better and is arguably easier to 
use than the standard options..

On Windows you can also read the content of IE using COM
but that's probably not the best approach.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list