Issue
from selenium import webdriver
driver = webdriver.Firefox()
numb = [*range(40, 70, 1)]
print(numb)
discount2 = driver.find_elements_by_partial_link_text(numb)
Im trying to search for everything in the range using discount 2; whenever I run this function it will search it as the whole thing.
Solution
You need to iterate over the numbers one by one:
discount = {} # create empty dict
for number in range(40, 70):
discount[number] = driver.find_elements_by_partial_link_text(str(number))
Now, the results will be stored in the discount
dict using number
as the key. I also called str()
on number
because you'll be searching strings.
Answered By - MattDMo
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.