How to get the selected text of the webpage in chrome through python ?

Bruno Dupuis lisael at lisael.org
Tue Jan 8 14:19:51 CET 2013


On Mon, Jan 07, 2013 at 08:20:28PM -0800, iMath wrote:
> How to get the selected text of the webpage in chrome through python ?

What you need is a way to get selected text from wherever it comes. The
way to do this depends on your graphical environment. If you use X, i'd make a
a quick and dirty call to xclip -o, although there must be a pure python
implementation which in turn depends on the python framework you play
with (gtk/qt/wx/tk/...).

Short answer is : it depends on your system, and it may be easier and more
portable if you use a graphical toolkit.

cheers.

-- 
Bruno Dupuis




More information about the Python-list mailing list