Screen Scraping for Modern Applications?

L

ljr2600

Hello,

I'm very new to python and still familiarizing myself with the
language, sorry if the post seems moronic or simple.

For a side project I'm working on I need to be able to scrape a modern
computer desktop. Is there any basic material already available to do
this? I'd rather not need to write my own to interact with hardware.

Thanks!
 
C

Cameron Laird

.
.
.
For a side project I'm working on I need to be able to scrape a modern
computer desktop. Is there any basic material already available to do
this? I'd rather not need to write my own to interact with hardware.
.
.
.
Oh, no.

Very hard. Very, very hard.

At least as you've expressed it here, this is an exceptionally
difficult task. What does "scrape" mean to you? Do you want
to reproduce the display remotely, or extract text, or some other
possibility? Does "modern computer" mean Windows to you?
 
K

KenAggie

I just learned about a python library called BeautifulSoup in a thread
responding to my Southwest Airlines script that I wrote and posted on
the Python cookbook web site. I wrote my script using the provided
HTMLParser class. BeautifulSoup could have saved me some time perhaps.
Take a look. Feel free to browse my code for an example of how to use
HTMLParser for a moderately involved project.

BeautifulSoup link:
http://www.crummy.com/software/BeautifulSoup/

My Southwest Boarding pass script link:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496790

Enjoy.
- Ken
 
D

Dennis Lee Bieber

For a side project I'm working on I need to be able to scrape a modern
computer desktop. Is there any basic material already available to do
this? I'd rather not need to write my own to interact with hardware.
What OS?
What Window Manager?

And what, exactly do you mean by "scrape"?

Under WinXP, a user's personal desktop icons are shortcuts found in
c:\documents and settings\<username>\desktop

with shared items using "all users" for <username>

However, "My Computer", "My Documents", "My Network Places" are
controlled via other settings -- perhaps the registry...

I suspect under KDE this stuff is either a .ksomething file, or a
..kdirectory with files.


Neither of which qualify as "interact with hardware" -- they are all
software dependent upon the privileges of the program/user...
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
L

ljr2600

Cameron said:
.
.
.
.
.
.
Oh, no.

Very hard. Very, very hard.

At least as you've expressed it here, this is an exceptionally
difficult task. What does "scrape" mean to you? Do you want
to reproduce the display remotely, or extract text, or some other
possibility? Does "modern computer" mean Windows to you?

Scrape means simply scraping pixel colors from locations on the screen.
I'll worry about assembling it into meaningful information.

Previously, I used Java, and it has a very handy built in class called
Robot that can, amongst other things, report the color of on screen
pixels. Thusly, I assumed the task could be accomplished reasonably
easily.
 
P

Paul McGuire

Scrape means simply scraping pixel colors from locations on the screen.
I'll worry about assembling it into meaningful information.

I've used pywinauto to interact with a Flash animation panel, running within
an Internet Explorer browser. By "interact" I mean moving and clicking the
mouse, and capturing images, which can then be processed to access
individual pixels.

-- Paul
 
D

Daniel Nogradi

Scrape means simply scraping pixel colors from locations on the screen.
import ImageGrab
im = ImageGrab.grab()
v = im.getpixel((x, y))

requires:

http://www.pythonware.com/products/pil/

</F>

##
# (New in 1.1.3) The <b>ImageGrab</b> module can be used to copy
# the contents of the screen to a PIL image memory.
# <p>
# The current version works on Windows only.</p>
#

How about doing the same on linux?
 
C

Cameron Laird

.
.
.
Scrape means simply scraping pixel colors from locations on the screen.
I'll worry about assembling it into meaningful information.

Previously, I used Java, and it has a very handy built in class called
Robot that can, amongst other things, report the color of on screen
pixels. Thusly, I assumed the task could be accomplished reasonably
easily.

I understand far better now. Others have already pointed you toward
pywinauto and so on. There are several other possibilities, including
the BLT extension, reliance under Unix on xwd and xwdtoppm, and more.
I think I should point out that Robot, potent though it is, is *not*
universal: in an X11 environment, for example, it requires XTEST.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top