AttributeError: 'list' object has no attribute 'click' - Selenium Webdriver using Python [duplicate]
This question already has an answer here:
'list' object has no attribute 'get_attribute' while iterating through WebElements
3 answers
I am trying to use click command in Selenium webdriver using python. But I am getting the below error. Can some one help me?
Traceback (most recent call last):
File "C:/Users/Sagnik/Desktop/pp.py", line 13, in <module>
user.click()
AttributeError: 'list' object has no attribute 'click'
Below is my code:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('url')
input("Anything after scanning QR code")
names = ["ABC", "DEF"]
for name in names:
print(name)
user = driver.find_elements_by_xpath('//span[@title = "{0}"]'.format(name))
user.click()
I think I am missing something. please suggest me
python selenium selenium-webdriver webdriver attributeerror
marked as duplicate by DebanjanB
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 5 at 10:46
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
'list' object has no attribute 'get_attribute' while iterating through WebElements
3 answers
I am trying to use click command in Selenium webdriver using python. But I am getting the below error. Can some one help me?
Traceback (most recent call last):
File "C:/Users/Sagnik/Desktop/pp.py", line 13, in <module>
user.click()
AttributeError: 'list' object has no attribute 'click'
Below is my code:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('url')
input("Anything after scanning QR code")
names = ["ABC", "DEF"]
for name in names:
print(name)
user = driver.find_elements_by_xpath('//span[@title = "{0}"]'.format(name))
user.click()
I think I am missing something. please suggest me
python selenium selenium-webdriver webdriver attributeerror
marked as duplicate by DebanjanB
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 5 at 10:46
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
'list' object has no attribute 'get_attribute' while iterating through WebElements
3 answers
I am trying to use click command in Selenium webdriver using python. But I am getting the below error. Can some one help me?
Traceback (most recent call last):
File "C:/Users/Sagnik/Desktop/pp.py", line 13, in <module>
user.click()
AttributeError: 'list' object has no attribute 'click'
Below is my code:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('url')
input("Anything after scanning QR code")
names = ["ABC", "DEF"]
for name in names:
print(name)
user = driver.find_elements_by_xpath('//span[@title = "{0}"]'.format(name))
user.click()
I think I am missing something. please suggest me
python selenium selenium-webdriver webdriver attributeerror
This question already has an answer here:
'list' object has no attribute 'get_attribute' while iterating through WebElements
3 answers
I am trying to use click command in Selenium webdriver using python. But I am getting the below error. Can some one help me?
Traceback (most recent call last):
File "C:/Users/Sagnik/Desktop/pp.py", line 13, in <module>
user.click()
AttributeError: 'list' object has no attribute 'click'
Below is my code:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('url')
input("Anything after scanning QR code")
names = ["ABC", "DEF"]
for name in names:
print(name)
user = driver.find_elements_by_xpath('//span[@title = "{0}"]'.format(name))
user.click()
I think I am missing something. please suggest me
This question already has an answer here:
'list' object has no attribute 'get_attribute' while iterating through WebElements
3 answers
python selenium selenium-webdriver webdriver attributeerror
python selenium selenium-webdriver webdriver attributeerror
asked Jan 2 at 3:22
Sagnik ChattopadhyayaSagnik Chattopadhyaya
63
63
marked as duplicate by DebanjanB
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 5 at 10:46
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by DebanjanB
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 5 at 10:46
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
find_elements_by_xpath()
returns a list of results. Maybe you want find_element_by_xpath
instead?
add a comment |
Use @DanielleM.'s solution if user
is a list with only one element, otherwise do:
for i in user:
i.click()
Instead of:
user.click()
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
find_elements_by_xpath()
returns a list of results. Maybe you want find_element_by_xpath
instead?
add a comment |
find_elements_by_xpath()
returns a list of results. Maybe you want find_element_by_xpath
instead?
add a comment |
find_elements_by_xpath()
returns a list of results. Maybe you want find_element_by_xpath
instead?
find_elements_by_xpath()
returns a list of results. Maybe you want find_element_by_xpath
instead?
answered Jan 2 at 3:28


Danielle M.Danielle M.
1,9251523
1,9251523
add a comment |
add a comment |
Use @DanielleM.'s solution if user
is a list with only one element, otherwise do:
for i in user:
i.click()
Instead of:
user.click()
add a comment |
Use @DanielleM.'s solution if user
is a list with only one element, otherwise do:
for i in user:
i.click()
Instead of:
user.click()
add a comment |
Use @DanielleM.'s solution if user
is a list with only one element, otherwise do:
for i in user:
i.click()
Instead of:
user.click()
Use @DanielleM.'s solution if user
is a list with only one element, otherwise do:
for i in user:
i.click()
Instead of:
user.click()
answered Jan 2 at 3:33


U9-ForwardU9-Forward
16.7k51643
16.7k51643
add a comment |
add a comment |