使用python访问网站并将网站图像打印到文件 [英] using python to visit web sites and print the web sites image to files

查看:89
本文介绍了使用python访问网站并将网站图像打印到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我想知道是否可以使用python模拟真实用户来执行以下操作:

1)在浏览器中打开一个网站;

2)打印屏幕,以便将当前活动窗口图像复制到

剪贴板;

3)将图像文件保存为真实文件


任何指针都会被指定!


Xiong

Hi there,

I wonder whether python can be used to simulate a real user to do the
following:
1) open a web site in a browser;
2) printscreen, so to copy the current active window image to
clipboard;
3) save the image file to a real file

Any pointer will be apprieciated!

Xiong

推荐答案

3月12日上午7:32,imx < xiong.xu ... @ gmail.comwrote:
On Mar 12, 7:32 am, "imx" <xiong.xu...@gmail.comwrote:

我想知道python是否可以用来模拟真实用户来做

以下:

1)在浏览器中打开一个网站;

2)打印屏幕,以便将当前活动窗口图像复制到

剪贴板;

3)将图像文件保存到真实文件中

任何指针都会被指定!

雄熊
I wonder whether python can be used to simulate a real user to do the
following:
1) open a web site in a browser;
2) printscreen, so to copy the current active window image to
clipboard;
3) save the image file to a real file
Any pointer will be apprieciated!
Xiong



Google pywinauto。


HTH


Davy

Google pywinauto.

HTH

Davy


>

我想知道python是否可以用来模拟真实用户来执行

以下:

1)在浏览器中打开一个网站;

2)printscreen,所以要将当前活动窗口图像复制到

clipboard;

3)将图像文件保存为真实文件


任何指针都会被指定!
>
I wonder whether python can be used to simulate a real user to do the
following:
1) open a web site in a browser;
2) printscreen, so to copy the current active window image to
clipboard;
3) save the image file to a real file

Any pointer will be apprieciated!



哪个操作系统?

Which OS?


你绝对可以用python创建一个web bot。您开车并不需要

真正的网络浏览器。有图书馆打开网页

页面,抓取他们的内容,然后下载。这将使你的平台中立。驱动GUI浏览器有可能成为一个可能无法处理不同浏览器,不同的b $ b平台,甚至可能无法处理不同版本的脆弱脚本。


我运行一个mediawiki网站,发现一个方便的基于python的库

编写来管理它,名为pywikipediabot在 http://sourceforge.net/projects/pywikipediabot/


好​​的,这个图书馆赢了不要让你的腿为你工作,但它有件b / b $ b $以及演示如何使用python浏览网站的部件。然后,

使用HTML解析器,你可以搜索图像。


格雷格

You can definitely create a web bot with python. It doesn''t require
that you "drive" A real web browser. There are libraries to open web
pages, scrape their contents, and do downloading. That would make your
bot platform neutral. Driving a GUI browser has the risk of being a
brittle script that might not handle different browsers, different
platforms, maybe even not handle different versions.

I run a mediawiki web site, and found a handy python-based library
written to manage it called pywikipediabot at http://sourceforge.net/projects/pywikipediabot/.

Okay, this library won''t do your leg work for you, but it has pieces
and parts that demonstrate how to use python to surf a web site. Then,
with an HTML parser, you can hunt down images.

Greg


这篇关于使用python访问网站并将网站图像打印到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆