如何使用Selenium Python在输入标签中查找和编写 [英] How to find and write inside an input tag with selenium python

查看:144
本文介绍了如何使用Selenium Python在输入标签中查找和编写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在网站 https中将输入标签的值更改为20到110. ://www.tradingview.com/chart/.我实际上该怎么做?(所有这些都使用Selenium python) 我要更改其值为Vol内的MA长度,您可以通过单击网站左上方的Apple Inc-D-Cboe BZX右下方的Vol(20)来访问.

I would like to change a value of a input tag that haves the value 20 to 110 in the website https://www.tradingview.com/chart/. How can I actually do that?(all of that using selenium python) The value i would like to change it's MA Length inside Vol, you can acess that by clicking at Vol(20) right below Apple Inc - D - Cboe BZX at the top left part of the website.

推荐答案

  1. 使用您的最喜欢的浏览器开发人员工具

示例代码:

driver.get("https://www.tradingview.com/chart/")

WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//a[contains(@class,'format')]"))).click()
input = WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.XPATH, "//input[contains(@class,'innerInput')]")))
driver.execute_script("arguments[0].value=30", input)

这篇关于如何使用Selenium Python在输入标签中查找和编写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆