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 Answer
Locate the element you would like to interact with using your favourite browser developer tools
- Choose an appropriate Locator Strategy which will allow to uniquely match the element at the page
- Locate the element
- Wrap the locating code into an Explicit Wait this way your test will be more robust and reliable
- Use WebElement APIs to interact with elements
Example code:
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)
3 Comments
Dmitri T
I believe it's better to raise a new one
Gustavo Molina
yeah, i was doing at that moment, i'll send u the link here
Gustavo Molina
there it's! stackoverflow.com/questions/57158950/…

Vol(20)doesn't brings up the popup. Any further steps involved? Possibly you need a set of valid credentials. Do you have a demo set?