更新时间:2023-11-27 20:51:28
您可以使用不同的CSS类的按钮:帐户保存按钮
You can use the distinct CSS class of the button: account-save-button
在VB.NET中,使用 HtmlDocument.GetElementsByTagName 是这样的:
In VB.NET, use HtmlDocument.GetElementsByTagName like this:
Private Sub ClickSaveButton()
If (WebBrowser1.Document IsNot Nothing) Then
Dim Elems As HtmlElementCollection
Dim WebOC as WebBrowser = WebBrowser1
Elems = WebOC.Document.GetElementsByTagName("BUTTON")
For Each elem As HtmlElement In Elems
Dim CssClass As String = elem.GetAttribute("classname")
If ((CssClass IsNot Nothing) And (CssClass.Length <> 0)) Then
If CssClass.ToLower().Contains("account-save-button") Then
elem.InvokeMember("click");
Exit For
End If
End If
Next
End If
End Sub
要只用Web浏览器验证它,从浏览器的开发者控制台,试试这个;它的工作原理,因为***使用jQuery:
To verify it with just a web browser, try this from your browser's developer console; it works because *** uses jQuery:
$(帐号保存按钮。)点击();
或者纯javascript: document.getElementsByClassName('帐户保存按钮')[0]。点击();
Or pure javascript: document.getElementsByClassName('account-save-button')[0].click();
有关参考,这里是按钮的标记:
For reference, here is the button's markup:
&LT;按钮类=YT-UIX按钮YT-UIX按钮大小默认YT-UIX键式主帐户保存按钮帐户动作按钮TYPE =提交的onclick =返回true;&GT;&LT;跨度类=YT-UIX键含量&GT;保存&LT; / SPAN&GT;&LT; /按钮&GT;
其他的想法:
更新
我查了的***参考,但我没有看到任何东西设置preferences上传的默认值。
I checked the *** API Reference, but I don't see anything for setting preferences for upload defaults.