how to retrive highlighted text in a browser?

W

wcc

Hello group,

When browsing websites, quite often I have to look up words in
dictionary. I'm hoping that I can come up with a python program that
does the following:

When I highlight some text in browser and right-click, besides the
default options such as COPY, PASTE, etc, I want an option that says
"Send to file", something like that. The file is a text file, with
fixed path. When I select this option, the highlighted text will be
appended to the text file. This way, I can collect those words &
phrases that I don't know.

Is this going to be a difficult task? I'm a newbie in python. TIA for
your help.

- wcc
 
J

Jordan Rastrick

I don't know how hard this would be to do in Python - appending text to
a file is straightforward, but it sounds like you'd need to extend the
browser itself to get the functionality you want. The most obvious
choice if you want an extensible browser is Mozilla Firefox
(http://www.mozilla.org/products/firefox/), but AFAIK its extensions
are written in C++, and I'm not sure how easy it would be to get Python
into the mix.

If you do get this working, I'd love to hear about it! I've wanted this
feature in browers for a long time.
 
C

Colin J. Williams

wcc said:
Hello group,

When browsing websites, quite often I have to look up words in
dictionary. I'm hoping that I can come up with a python program that
does the following:

When I highlight some text in browser and right-click, besides the
default options such as COPY, PASTE, etc, I want an option that says
"Send to file", something like that. The file is a text file, with
fixed path. When I select this option, the highlighted text will be
appended to the text file. This way, I can collect those words &
phrases that I don't know.

Is this going to be a difficult task? I'm a newbie in python. TIA for
your help.

- wcc
Firefox doesn't provide the file capture function you seek but, using a
readily available extension, does permit dictionary lookup using the
American Heritage Dictionary - the response comes with copious
advertising which is not overly intrusive.

Colin W.
 
W

wcc

Thanks for reply. I did not expect it to be a browser specific
problem. I've been using a freeware dictionary tool called wordweb (it
is a great tool) and it can detect highlighted text in browsers or
text editors, etc.. I'll keep searching. Thanks again. - wcc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top