Hiro 714
asked on
selenium python question
I want to select the button and click.
Would you advise?
Source
Python code
Jupyter Notebook Error Message
Would you advise?
Source
<a ui-sref="physical-item-view({id: item.id})" class="w-btn w-btn-action" ng-class="{'disabled' : item.isConsumable}" uib-tooltip="Details" tooltip-placement="top-right" tooltip-append-to-body="true" href="#/physical-item/1002152546"> <i class="fa fa-eye"></i> </a>
Please correct the following code.Python code
elem_login_btn = browser.find_element_by_class_name('w-btn wbtn-action')
elem_login_btn.click()
When I run, this message comes:Jupyter Notebook Error Message
NoSuchElementException Traceback (most recent call last)
<ipython-input-19-920f716fbe43> in <module>
----> 1 elem_login_btn = browser.find_element_by_class_name('w-btn wbtn-action')
2 elem_login_btn.click()
~\AppData\Roaming\Python\Python38\site-packages\selenium\webdriver\remote\webdriver.py in find_element_by_class_name(self, name)
562 element = driver.find_element_by_class_name('foo')
563 """
--> 564 return self.find_element(by=By.CLASS_NAME, value=name)
565
566 def find_elements_by_class_name(self, name):
~\AppData\Roaming\Python\Python38\site-packages\selenium\webdriver\remote\webdriver.py in find_element(self, by, value)
974 by = By.CSS_SELECTOR
975 value = '[name="%s"]' % value
--> 976 return self.execute(Command.FIND_ELEMENT, {
977 'using': by,
978 'value': value})['value']
~\AppData\Roaming\Python\Python38\site-packages\selenium\webdriver\remote\webdriver.py in execute(self, driver_command, params)
319 response = self.command_executor.execute(driver_command, params)
320 if response:
--> 321 self.error_handler.check_response(response)
322 response['value'] = self._unwrap_value(
323 response.get('value', None))
~\AppData\Roaming\Python\Python38\site-packages\selenium\webdriver\remote\errorhandler.py in check_response(self, response)
240 alert_text = value['alert'].get('text')
241 raise exception_class(message, screen, stacktrace, alert_text)
--> 242 raise exception_class(message, screen, stacktrace)
243
244 def _value_or_default(self, obj, key, default):
NoSuchElementException: Message: Unable to locate element: .w-btn wbtn-action
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried this, but not clicking.
elem_login_btn = browser.find_element_by_class_name("w-btn.w-btn-action")
elem_login_btn.click()
ASKER
I have tried, but still getting error
Open in new window
Error
Open in new window