Web scraping 使用Openoffice BASIC实现web自动化是否可行?

Web scraping 使用Openoffice BASIC实现web自动化是否可行?,web-scraping,openoffice-basic,Web Scraping,Openoffice Basic,我正在尝试在OpenOffice中做一些简单的Web垃圾处理(我通常在Excel中工作,但我正在尝试为没有Excel的同事移植一些东西)。然而,当我尝试运行与此非常类似的东西时,它总是给我这个基本的运行时错误1 这是相关的代码,我不知道该怎么做才能让它工作 Sub Macro1 Dim explorer As Object Set explorer = CreateObject("InternetExplorer.Application") expl

我正在尝试在OpenOffice中做一些简单的Web垃圾处理(我通常在Excel中工作,但我正在尝试为没有Excel的同事移植一些东西)。然而,当我尝试运行与此非常类似的东西时,它总是给我这个基本的运行时错误1

这是相关的代码,我不知道该怎么做才能让它工作

Sub Macro1
    Dim explorer As Object
    Set explorer = CreateObject("InternetExplorer.Application")
    explorer.Visible = True
    explorer.navigate("www.yahoo.com")
    
    Const READYSTATE_COMPLETE As Long = 4
    Do While explorer.Busy Or explorer.readyState <> READYSTATE_COMPLETE
    Loop

    dim page as object
    set page = explorer.Document
    
    dim mailButton as object
    set mailButton = page.GetElementByID("ybar-navigation-item-mail") 'this is the line the error occurs on
    mailButton.Click
End Sub
Sub宏1
作为对象的Dim资源管理器
Set explorer=CreateObject(“InternetExplorer.Application”)
explorer.Visible=True
explorer.navigate(“www.yahoo.com”)
常数READYSTATE_完成,长度=4
在explorer.Busy或explorer.readyState readyState\u完成时执行
环
将页面变暗为对象
set page=explorer.Document
dim mailButton作为对象
set-mailButton=page.GetElementByID(“ybar导航项邮件”)'这是发生错误的行
邮件按钮。点击
端接头

您是否知道可以将脚本保存在
vbs
文件中(您必须删除变量声明中的类型),并通过双击直接运行脚本,而无需使用office应用程序?我建议你用这种方法