简体   繁体   English

在Windows下每5分钟运行一次python脚本

[英]Run python script every 5 minutes under Windows

I am having a simple python script scraping some data from html page and writing out results to a csv file. 我有一个简单的python脚本从html页面抓取一些数据并将结果写入csv文件。 How can I automate the scraping, ie kick it off every five minutes under Windows. 如何自动进行抓取,即在Windows下每五分钟启动一次。

Thanks Peter 谢谢彼得

Look into this link: http://blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip/ 请查看以下链接: http//blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip/

You'll need to change some settings in Windows Task Scheduler to run the script every five minutes, otherwise the above tutorial works nicely. 您需要更改Windows任务计划程序中的某些设置以每五分钟运行一次脚本,否则上述教程可以正常运行。

If you are using Windows i would suggest using Windows Task Scheduler, it's quite simple thanks to the UI and from there Trigger your Python code. 如果您使用的是Windows,我建议您使用Windows任务计划程序,这要归功于用户界面和触发您的Python代码。

For a server environment like Linux you could set up a Cron task. 对于像Linux这样的服务器环境,您可以设置Cron任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM