-2

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)

enter image description here To get that especific graph, what you need to do is: 1. Click at the "Indicators & Strategies" button 2.At the input, type: "Bollinger Bands" and select the first one at the right

After you get the graph, click at BB(20 close 2) right bellow Vol (20). What i would like to change it's the value "lenght" that's 20 to 110

0

1 Answer 1

3

This works for me:

browser.find_element_by_xpath("/html/body/div[1]/div[1]/div[3]/div[1]/div/table/tr[1]/td[2]/div/div[3]/div[2]/span[1]/span").click()

time.sleep(.5)
browser.find_element_by_xpath("/html/body/span/div[1]/div/div/table/tbody/tr[23]").click()

time.sleep(.5)
browser.find_element_by_xpath("//*[@id='overlap-manager-root']/div/div/div[1]/div/div[3]/div/div[2]/div/div/div/div/div[1]/input").send_keys(Keys.CONTROL,"a")
browser.find_element_by_xpath("//*[@id='overlap-manager-root']/div/div/div[1]/div/div[3]/div/div[2]/div/div/div/div/div[1]/input").send_keys(Keys.DELETE)
browser.find_element_by_xpath("//*[@id='overlap-manager-root']/div/div/div[1]/div/div[3]/div/div[2]/div/div/div/div/div[1]/input").send_keys('value', '110')
browser.find_element_by_xpath("//*[@id='overlap-manager-root']/div/div/div[1]/div/div[4]/div[2]/span").click()

You might want to use WebDriverWait and look for better selectors, but it works at the time I am writing this.

Sign up to request clarification or add additional context in comments.

11 Comments

i've tested with that driver.find_element_by_xpath('//*[@id="overlap-manager-root"]/div/div/div[1]/div/div[3]/div/div[2]/div/div[@class = "innerInputContainer-FSOtBYl0-"]').click().send_keys('110')
actually, the last question wasn't what i really wanted to do, i was just trying to understand how to do with a example that is simple to acess. But i've not understood hahaha
@MichaelNovello This answer looks good. Possibly the initial version of your answer was more of a comment and the downvotes were casted against that. However I have upvoted the current version.
@DebanjanB Thank you. My initial response was brief and just asked if he'd tried a couple of functions I thought of, since his initial question didn't include his code or any mention of what he'd already tried.
@DebanjanB I get that. It wouldn't let me comment, so I went with an answer that wasn't really an answer. I'm glad I was able to turn it around at least!
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.