javascript - 在网站的移动版本中选择一个选项(响应模式)
问题描述
当我以响应模式浏览它时,如何从https://www.supremenewyork.com/mobile#products/305278中选择尺寸选项?我试过了,document.querySelector("#size-options > option:nth-child(2)").selected = "selected";
但它不起作用。
在桌面模式下https://www.supremenewyork.com/shop/pants/n1to4psjk/wlmx7p5hr该方法document.querySelector("#size > option:nth-child(3)").selected = "selected";
按预期工作。
解决方案
您可以使用
document.querySelector("#order_billing_country").value = "countryCode";
它,它可以在桌面和移动设备上运行。移动端的 UI 永远不会更新,但是当你按下流程支付时,正确的值会发送给 Supreme。
推荐阅读
- javascript - 从 json 响应中查找下一个最接近的日期和时间
- python - 结合2个for循环
- python - 如何创建一个财政年度的销售累计计数器?
- python - 追加列表理解时出现 Python 错误
- ios - 无法在 iOS 15 的侧边栏列表部分中同时呈现文本视图和 DatePicker
- python - 如何将脚本分解为更小的函数并创建 main.py?
- python - 如何修复 _pickle.PicklingError: can'tpickle : 它不是同一个对象
- javascript - 查找 TensorFlow.js 训练进度
- database - 电子商务平台并发请求的系统设计
- php - 在php中替换字符串中多次出现的字符