macOS Big Sur:如何使用自动器(或其他工具)构建脚本以随时间推移收集数据 [英] macOS Big Sur: How to use automator (or something else) to build a script for collecting data over time

查看:45
本文介绍了macOS Big Sur:如何使用自动器(或其他工具)构建脚本以随时间推移收集数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对股票感兴趣,我想构建一个自动化脚本,以便在很长一段时间内从网页上连续不断地收集数据,并包含许多数据点,然后将这些数据传输到excel文件中,并创建一个持续的文件.测量利息存量.我将脚趾浸入Automator中,但是我会乐于学习其他方法来完成部分或全部任务.

I'm interested in a stock and I would like to build an automated script to collect data continuously from a webpage over a long period of time and with many data points, transfer that data to an excel file, and create an ongoing measure for the stock of interest. I have dipped my toe into Automator to do this but I would be receptive to learning of other methods to complete parts or all of this task.

我用

获取指定的查找器项目"

"Get Specified Finder Items"

调用该股票信息所在的网页,然后

to call the webpage where the stock info is, then

打开Finder项,使用Safari打开"

"Open Finder Items, Open with: Safari"

打开网页.然后我被卡住了.

to open the webpage. Then I'm stuck.

我用

从网页获取文本"

从网页上获取纯文本,我得到

to get plain text from webpage and I get

从网页获取文本失败-1个错误,框架加载中断".

"Get Text from Webpage failed - 1 error, Frame load interrupted".

我曾尝试使用此错误消息进行搜索,但是在遇到其他情况时会显示错误代码,而在我遇到的方式中却找不到,并且我无法找到故障排除指南来解决Automator中的错误.

I've tried googling this error message but that brings up the error code in other contexts than how I encounter it and I can't find a troubleshooting guide to help with the error in Automator.

有人可以给我一个为什么从网页获取文本"的原因吗?导致帧加载中断".错误?没有选择解决问题的方法,而是解决问题的方法.只是模糊的错误.

Can someone give me a reason why "Get Text from Webpage" results in a "frame load interrupted" error? There are no options to problem solve what to do to solve the problem; just the vague error.

有关如何构建程序以全天候盲目收集数据的任何其他帮助,因此我不必一定会有所帮助.我没有看到在automator中使用excel的任何选项,而且我也不知道如何使用从网页获取文本"指定要从网页中提取什么文本.我正在使用的页面上有很多文本,我只想在运行时提取当前股价.

Any additional help on how to build a program to mindlessly collect data over the day so I don't have to would be helpful. I don't see any options in automator to work with excel and I also don't know how to use "Get Text from Webpage" to specify what text to pull from the webpage. There is a lot of text on the page I'm using and I just want to pull the current stock price at the time of running.

为澄清起见,我使用的是配备Big Sur的MacBook Pro,因此我需要与macOS相关的帮助来解决我们正在解决的问题.感谢您的帮助.

To clarify, I'm using a MacBook Pro with Big Sur so I need help with macOS for the problem we are working with. Thanks for any help.

推荐答案

只是一个想法..也许您可以制作一个shell脚本,该脚本将1)使用curl提取Web数据,2)解析它,3)追加将有用的位放入CSV文件并实现相同的目标?然后,您可以将其放在crontab中,以定期提取数据.

Just a thought.. perhaps you could make a shell script that would 1) use curl to pull the web data, 2) parse it, and 3) append the useful bits into a CSV file and achieve the same objective? You could then put it in your crontab to pull the data at regular intervals.

这篇关于macOS Big Sur:如何使用自动器(或其他工具)构建脚本以随时间推移收集数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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