我是VBA的初学者。我正在尝试使用VBA单击网页上的“刷新”按钮。但我不能这样做。
你能支持我吗?谢谢大家HTML
刷新“type =”submit“> 刷新
答案 0 :(得分:1)
尝试使用以下
public static ApiResponse uploadFileToServer(){
File file = new File("your asset path");
Map<String, Object> dataParams = new HashMap<String, Object>();
data.put("name", <file_name>);
data.put("file", file);
//here type and name are necessary to create entity
data.put("type", <collection_name>);
data.put("name", <entity_name>);
//entity_name will be the name of your new created entity.
Client client = new Client(<organization_name>, <application_name>);
client.setApiUrl(<url to hit>);
client.authorizeAppUser(<username>, <password>);
client.createEntity(dataParams);
String <uri> = <collection_name> + "/" + <entity_name>;
ApiResponse response = client.httpRequest(HttpMethod.POST,ApiResponse.class, null, dataParams, <organization_name>, <application_name>,
<uri>);
return response;
}
编辑1
'References
' 1) Microsoft Internet Controls
' 2) Microsoft HTML Object Library
Sub test()
Dim oHTML_Element As IHTMLElement
Dim oBrowser As InternetExplorer
Dim ie As Variant
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate "" ' Your webpage goes here
While ie.readyState <> READYSTATE_COMPLETE And ie.readyState <> READYSTATE_LOADED
DoEvents
Wend
For Each oHTML_Element In ie.document.getElementsByName("submit")
oHTML_Element.Click
Next
End Sub
答案 1 :(得分:1)