Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36428

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.134.4.91.MISMATCH!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.028
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'python,': 0.02; 'subject:text': 0.05; 'differently': 0.07; 'subject:How': 0.09; 'python': 0.09; 'accepts': 0.09; 'subject:python': 0.11; 'suggest': 0.11; 'subject: \n ': 0.16; 'subject:through': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'copied': 0.17; 'jan': 0.18; 'equivalent': 0.20; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'am,': 0.27; 'realize': 0.27; 'start,': 0.27; 'probably': 0.29; 'returned': 0.30; 'subject: ?': 0.30; 'function': 0.30; 'to:addr:python-list': 0.33; 'text': 0.34; 'something': 0.35; 'quite': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'there,': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'hints': 0.65; 'webpage': 0.65; 'header:Reply-To:1': 0.68; 'skip:n 30': 0.69; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'subject:get': 0.81; '2013': 0.84; 'addon': 0.84; 'not...': 0.84; 'received:74.208.4.194': 0.84; 'selection,': 0.84; 'dennis': 0.91
Date Tue, 08 Jan 2013 08:11:30 -0500
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: How to get the selected text of the webpage in chrome through python ?
References <b181f61b-c5c9-461a-9acc-8c79e257fae7@googlegroups.com> <dn4oe8hv6ulm6ea8edhr5luiir861f1u7q@invalid.netcom.com>
In-Reply-To <dn4oe8hv6ulm6ea8edhr5luiir861f1u7q@invalid.netcom.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:8e2HoqjDByNibw2msBUrf48XgLNOudPAxHT8X78esyP uxz7oqQbykzevRPhLpxER39LsMbrzoeNgtUFZaTM9qemllbyJS TK+1VnYyDW3axfnmNcHPFMzhWAE8B5JJ7I+864Vp2DYk0JxefB 4DN0SHdBR+arqwOEYe1QIDlt+/j6mKwEzw2AiSlbQt+9m2RYOL 1eaiu5g2wE0zXp3N9yCTjoMXni21NVypKra2kUBfveqHM6xmQn /2JWcEa7BFIlIvEWcJZPbiGSIhta5SxXHMQS+bIAZWGvRYn3/U 2cL+4Rwjr6cLeiGhomAWTUsWw6cqpfjrKBP7kYCWzPF3Yp03A= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To d@davea.name
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.273.1357650704.2939.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357650704 news.xs4all.nl 6871 [2001:888:2000:d::a6]:47431
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36428

Show key headers only | View raw


On 01/08/2013 07:38 AM, Dennis Lee Bieber wrote:
> On Mon, 7 Jan 2013 20:20:28 -0800 (PST), iMath <redstone-cold@163.com>
> declaimed the following in gmane.comp.python.general:
>
>> How to get the selected text of the webpage in chrome through python ?
> 	Chrome is a browser, is it not... If you want to get the text in
> Python, you have to write the equivalent of a browser -- something that
> parses the returned HTML message, extracting the parts you want.

To get a selection, you can either wait till it's copied to the
clipboard, and get it from there, or you can write a addon for the
application.  Since Chrome accepts addons, I suggest you research that
angle.  Probably mozilla.org is the place to start, and function

nsISelectionController::GetSelection() might be some place to examine.

You might find some hints in
http://stackoverflow.com/questions/2671474/range-selection-and-mozilla


if you are going to work with the clipboard, realize that it works quite
differently from one OS to another, and even from one desktop manager to
another.

-- 

DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to get the selected text of the webpage in chrome through python ? iMath <redstone-cold@163.com> - 2013-01-07 20:20 -0800
  Re: How to get the selected text of the webpage in chrome through python ? iMath <redstone-cold@163.com> - 2013-01-08 02:52 -0800
  Re: How to get the selected text of the webpage in chrome through python ? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-08 07:38 -0500
  Re: How to get the selected text of the webpage in chrome through python ? Dave Angel <d@davea.name> - 2013-01-08 08:11 -0500
    Re: How to get the selected text of the webpage in chrome through python ? iMath <redstone-cold@163.com> - 2013-01-08 18:54 -0800
    Re: How to get the selected text of the webpage in chrome through python ? iMath <redstone-cold@163.com> - 2013-01-08 18:54 -0800
  Re: How to get the selected text of the webpage in chrome through python ? Bruno Dupuis <lisael@lisael.org> - 2013-01-08 14:19 +0100
    Re: How to get the selected text of the webpage in chrome through python ? iMath <redstone-cold@163.com> - 2013-01-08 18:47 -0800
    Re: How to get the selected text of the webpage in chrome through python ? iMath <redstone-cold@163.com> - 2013-01-08 18:47 -0800
  Re: How to get the selected text of the webpage in chrome through python ? Miki Tebeka <miki.tebeka@gmail.com> - 2013-01-08 06:01 -0800
  Re: How to get the selected text of the webpage in chrome through python ? Alister <alister.ware@ntlworld.com> - 2013-01-09 09:35 +0000
    Re: How to get the selected text of the webpage in chrome through python ? iMath <redstone-cold@163.com> - 2013-01-09 17:55 -0800

csiph-web