gpt4 book ai didi

html - 使用 MS Access VBA 提交 HTML 表单

转载 作者:行者123 更新时间:2023-11-28 03:25:42 26 4
gpt4 key购买 nike

我在 Access 数据库表单中编写了以下表单。

Function Submit_Web_Form()

Dim ie As Object

Set ie = CreateObject("internetexplorer.application")

ie.navigate "http://www.webstaurantstore.com/bakers-pride-bco-e2-cyclone-series-electric-convection-oven-double-deck/155BCOE2.html"

ie.Visible = True

While ie.busy
DoEvents
Wend

ie.Document.all("from").Value = "Add"
ie.Document.all("weight").Value = "0"
ie.Document.all("price").Value = "5400.00"
ie.Document.all("description").Value = "Bakers%20Pride%20BCO%2DE2%20Cyclone%20Series%20Electric%20Convection%20Oven%20Double%20Deck"
ie.Document.all("uom").Value = "Each"
ie.Document.all("shipping").Value = "C"
ie.Document.all("taxcode").Value = "Y"
ie.Document.all("mnbuy").Value = "1"
ie.Document.all("mxbuy").Value = "1"
ie.Document.all("suffix").Value = "Voltage"
ie.Document.all("group").Value = "Y"
ie.Document.all("item_number").Value = "155BCOE2 240/1"
ie.Document.all("qty").Value = "1"
ie.Document.Forms(0).submit

While ie.busy
DoEvents
Wend

Set ie = Nothing

End Function

虽然该函数不会产生任何错误,但它不会提交表单。我需要自动将产品添加到购物车。

有没有人有通过 VBA 处理网页的经验?

最佳答案

您需要使用 HTML 对象库。请看一下我前段时间写的这篇文章:Access and the web HTML Object Library .如果您决定使用这种方法,我可以进一步帮助您。

问候

关于html - 使用 MS Access VBA 提交 HTML 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21322988/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com