私はxmlhttp
をvbaからExcel 2010で使用しています。プログラムで、ウェブサイトのショッピングカートに商品を追加する必要があります。私はこれまでのところコードを持っていますが、それはPOST
メソッドを使用していますvbaとxmlhttpのウェブサイトにある投稿フォームを自動送信する
私のコードに間違っていると思いますが、修正方法がわかりません - フォームが送信されている場所は表示されません。ここではそのURLは次のとおりです。私は、フォームを処理し、URLとして入力
http://www.craft-e-corner.com/p-2688-new-testament-cricut-cartridge.aspx
urlは「フォーム」の「アクション=」の部分でURLです。
フォームが投稿されたことを確認するにはどうすればよいですか?
Sub post_frm()
Dim xmlhttp As Object
Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
' Indicate that page that will receive the request and the
' type of request being submitted
xmlhttp.Open "POST", "http://www.craft-e-corner.com/addtocart.aspx?returnurl=showproduct.aspx%3fProductID%3d2688%26SEName%3dnew-testament-cricut-cartridge", False
' Indicate that the body of the request contains form data
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
' Send the data as name/value pairs
xmlhttp.send "Quantity=1&VariantID=2705&ProductID=2688"
Set xmlhttp = Nothing
End Sub
+1良いアイデアきれいresponsetextをテストするためにIEを使用します – brettdj