我正在为交易视图的订单自动化工作。虽然我已经取得了一些进展,但改变限量订单的价格(以及数量,任何数字)一直是一个挑战。我可以更改输入上的值,但它在应用程序模型中并没有真正更新(因此,buy按钮永远不会反映更改)。
任何帮助都将受到高度的感谢。
最好的

发布于 2020-06-26 07:20:34
有时,值的视图不是双向连接到隐藏输入字段的。看起来交易应用程序使用了一些响应式的框架,他们通常集成一些UI组件库,而这些组件库将真正的输入域隐藏在正面面向ux视图的漂亮掩膜后面。
这里有两个选项
// Let's say pure js
// Keep in mind, id of element, not a hidden input field.
const dropdown = document.getElementById('idOfHTMLElement');
dropdown.click(); // After click the options of the dropdown should appear
const options = Array.from(document.getElementsByClassName('classNameOfDropDownOption'));
const desiredOption = options.find((option) => option.someConditionLikePriceOrSmthElse: boolean);
desiredOption.click();
// Something like this, not accurate code, please test and correct if you will use this
https://stackoverflow.com/questions/62585628
复制相似问题