Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!hq-usenetpeers.eweka.nl!81.171.88.15.MISMATCH!eweka.nl!lightspeed.eweka.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.039 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'subject:text': 0.05; 'subject:How': 0.09; 'python': 0.09; 'portable': 0.09; 'subject:python': 0.11; '-o,': 0.16; 'subject: \n ': 0.16; 'subject:through': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'jan': 0.18; "i'd": 0.22; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'environment.': 0.27; 'framework': 0.30; 'subject: ?': 0.30; 'system,': 0.32; 'to:addr:python-list': 0.33; 'text': 0.34; 'there': 0.35; 'received:org': 0.36; 'depends': 0.36; 'charset:us-ascii': 0.36; 'turn': 0.36; 'subject:: ': 0.38; 'easier': 0.38; 'to:addr:python.org': 0.39; 'short': 0.39; 'your': 0.60; 'content-disposition:inline': 0.60; 'more': 0.63; 'webpage': 0.65; 'subject:get': 0.81; '2013': 0.84; 'dirty': 0.91; 'graphical': 0.91 Date: Tue, 8 Jan 2013 14:19:51 +0100 From: Bruno Dupuis To: python-list@python.org Subject: Re: How to get the selected text of the webpage in chrome through python ? References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357651549 news.xs4all.nl 6891 [2001:888:2000:d::a6]:53912 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36429 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