There is a site of this type
At the top you can see the buttons that I can’t click on.
Here is the code itself
from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Chrome() driver.get('https://coinmarketcap.com/currencies/bitcoin/#charts') driver.find_element_by_class_name('highcharts-button highcharts-button-normal').click() driver.save_screenshot('screencoin.jpg') driver.quit() Here is the code for this button taken from the site.
<g class="highcharts-button highcharts-button-normal" style="cursor:pointer;" transform="translate(122,0)"><rect fill="#f7f7f7" class=" highcharts-button-box" x="0" y="0" width="32" height="22" rx="2" ry="2"></rect><text x="8.4296875" style="font-weight:normal;color:#333333;fill:#333333;" y="14">1d</text></g> Tried to substitute another class.
driver.find_element_by_class_name('highcharts-button-box').click() As a result, I get these errors
Traceback (most recent call last): File "crypto.py", line 6, in <module> driver.find_element_by_class_name('highcharts-button highcharts-button-normal').click() File "/Users/milkiweed/Desktop/VIRTUAL_ENV/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 555, in find_element_by_class_name return self.find_element(by=By.CLASS_NAME, value=name) File "/Users/milkiweed/Desktop/VIRTUAL_ENV/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 955, in find_element 'value': value})['value'] File "/Users/milkiweed/Desktop/VIRTUAL_ENV/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute self.error_handler.check_response(response) File "/Users/milkiweed/Desktop/VIRTUAL_ENV/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Compound class names not permitted (Session info: chrome=63.0.3239.132) (Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.12.6 x86_64 and one more to another attempt
Traceback (most recent call last): File "crypto.py", line 6, in <module> driver.find_element_by_class_name(' highcharts-button-box').click() File "/Users/milkiweed/Desktop/VIRTUAL_ENV/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 80, in click self._execute(Command.CLICK_ELEMENT) File "/Users/milkiweed/Desktop/VIRTUAL_ENV/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 628, in _execute return self._parent.execute(command, params) File "/Users/milkiweed/Desktop/VIRTUAL_ENV/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute self.error_handler.check_response(response) File "/Users/milkiweed/Desktop/VIRTUAL_ENV/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Element <rect fill="#f7f7f7" class=" highcharts-button-box" x="0" y="0" width="32" height="22" rx="2" ry="2"></rect> is not clickable at point (153, 64). Other element would receive the click: <text x="8.4296875" style="font-weight:normal;color:#333333;fill:#333333;" y="14">...</text> (Session info: chrome=63.0.3239.132) (Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.12.6 x86_64) 
