I am trying to collect name and price from things in ebay. For example I searched "armani", than I need to collect every item on first page using Selenium and append it to the list. But I have problem in my code:
mylist = list()
for a in driver.find_element_by_xpath(".//*[@id='item3aeba8d9f0']/div"):
name = a.findElement(By.xpath(".//*[@id='item3aeba8d9f0']/div/div[2]/h3]")).getText()
price = a.findElement(By.xpath(".//*[@id='item3aeba8d9f0']/div/div[3]/div[2]/div/span[1]/span")).getText()
mylist.append(name, price)
print(name)
The result should like: [[name, price],[name, price],...]
See Question&Answers more detail:os