Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element can't be scrolled into view #1

Closed
JulioCesarAntonyFraga opened this issue Mar 19, 2021 · 15 comments
Closed

Element can't be scrolled into view #1

JulioCesarAntonyFraga opened this issue Mar 19, 2021 · 15 comments

Comments

@JulioCesarAntonyFraga
Copy link

So... Guys, I was trying to run the project and got some errors. The first one was that when searching for strategy_tester, there was no such element, I suppos,e since i got the following error:

strategy_tester = driver.find_elements_by_xpath("//*[@class='title-1C5azoXt']")[2]
IndexError: list index out of range

Then I looked for the element name in the inspection window at firefox and found the right name (I guess):

image

It looks like now it started recognizing the element, but now i got this new error and I have no idea why. Can you guys help me?

selenium.common.exceptions.ElementNotInteractableException: Message: Element <div class="title-37voAVwR"> could not be scrolled into view

@JulioCesarAntonyFraga
Copy link
Author

JulioCesarAntonyFraga commented Mar 19, 2021

Looks like i had to change the elemment index to 1 instead of 2. Now I got some other elemments that I have to fix the name the script is looking for.

@JulioCesarAntonyFraga
Copy link
Author

The elements the script is looking for are not correct. They may have changed. Can you guys please update?

@Andddyyyyy
Copy link

Andddyyyyy commented Mar 23, 2021

I'm having exactly the same issue as above, if the repo can be updated that'd be amazing!

@tmmatherne
Copy link

Same here.... incorrect xpath
It’s possible the class=“title-xxx” is unique to the stock being tested

I wouldn’t know how to fix this but sure TreborNamor could

@JulioCesarAntonyFraga
Copy link
Author

I've been trying to fix it, and I kind of understood which elements they're trying to choose and all. At some point, it just can't find the element ".table-roles" or something like that ( I don't really remember the name). It just doesn't find it. I did tests, I replaced the code with the correct elements names, but in the end, this element just can't be find (even if it exists, and it actually does, at least it is shown in the page source code).

@tmmatherne
Copy link

I’ve managed to get it working.
change the xpath location as you pointed out in your comment title- and also the innerInput one as well. Make sure you are logged into TradingView and that you only have stoploss checked within settings when running stoploss script.

@JulioCesarAntonyFraga
Copy link
Author

JulioCesarAntonyFraga commented Mar 24, 2021

I’ve managed to get it working.
change the xpath location as you pointed out in your comment title- and also the innerInput one as well. Make sure you are logged into TradingView and that you only have stoploss checked within settings when running stoploss script.

I've made an account but the script always open the browser with it logged out.

I will try to apply the things you told me tomorrow. Thank you for the help.

Could help me with the account stuff though?

@tmmatherne
Copy link

Ahh yes. I had that same issue as well. Here is the fix for that. Go to Firefox address bad and type the following

about:preferences#privacy
The button next to History, select Use Custom Settings.

Turn off Always Use Private Browsing Mode Turn on Remember My Browsing And Download History At the bottom of the page, turn on Clear History When Firefox Closes. At the far right, press the Settings button. Turn on ONLY Cache and Form And Search History leaving the others off.

This will keep you logged into tradingview

@JulioCesarAntonyFraga
Copy link
Author

Ahh yes. I had that same issue as well. Here is the fix for that. Go to Firefox address bad and type the following

about:preferences#privacy
The button next to History, select Use Custom Settings.

Turn off Always Use Private Browsing Mode Turn on Remember My Browsing And Download History At the bottom of the page, turn on Clear History When Firefox Closes. At the far right, press the Settings button. Turn on ONLY Cache and Form And Search History leaving the others off.

This will keep you logged into tradingview

Thank you, man! I appreciate your help.

@Andddyyyyy
Copy link

Thanks for the help guys! I'm getting top to the point now ehere it will open the settings box to upodate the Stop loss/Take profit values but get this error:

Loading script...
script has timed out.
Traceback (most recent call last):
File "C:\Users\Andyf\OneDrive\Desktop\TradingView_Machine_Learning-master\scripts\takeprofit_linear.py", line 76, in
run_script(webdriver.driver)
File "C:\Users\Andyf\OneDrive\Desktop\TradingView_Machine_Learning-master\scripts\takeprofit_linear.py", line 41, in run_script
best_key = find.best_key()
File "C:\Users\Andyf\OneDrive\Desktop\TradingView_Machine_Learning-master\functions\find.py", line 5, in best_key
best_in_dict = max(profits, key=profits.get)
ValueError: max() arg is an empty sequence

Any ideas?

@JulioCesarAntonyFraga
Copy link
Author

Ahh yes. I had that same issue as well. Here is the fix for that. Go to Firefox address bad and type the following

about:preferences#privacy
The button next to History, select Use Custom Settings.

Turn off Always Use Private Browsing Mode Turn on Remember My Browsing And Download History At the bottom of the page, turn on Clear History When Firefox Closes. At the far right, press the Settings button. Turn on ONLY Cache and Form And Search History leaving the others off.

This will keep you logged into tradingview

Hey man! I can't manage to open the browser already logged in. I've done the stuf`f you said, but it just doesn't work. I have saved the account in the account settings at firefox but nothing sems to work. Do you have any idea?

@tmmatherne
Copy link

tmmatherne commented Mar 24, 2021

Did you save the root Directory or Local? Not sure if matters but I used the root directory
image

@batuhan3526
Copy link

Hello Are u guys got this error ? Could u help me ?
error
error3
@tmmatherne @JulioCesarAntonyFraga @Andddyyyyy

@TreborNamor
Copy link
Owner

hello everyone, it looks like the elements on Tradingview had changed. I updated the elements and added some extra fixes to script. If you guys are still having problems please download the new repository.

@tmmatherne
Copy link

thanks @TreborNamor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants