I am trying to output the text of a the selected dropdown option on ebay. I want to output the text and then the price of the item (eventually) as different drop down options are selected (which is why i don't want to scrape a list of dropdown values all at once). I have tried this code:
from selenium import webdriver
import csv
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
browser = webdriver.Chrome(executable_path='C:\Users\user\PycharmProjects\seleniumTest\drivers\chromedriver.exe')
browser.get('https://www.ebay.co.uk/itm/Wooden-Box-Coins-Coin-Capsules-Display-Storage-Case-for-Collectible-50-100-New/392274824564')
posts = browser.find_element_by_xpath("//select[@id='msku-sel-1']").send_keys(Keys.DOWN) // this just selects the option after select
for post in posts:
print(post.text)
Would be extremely grateful if some help can be provided!
However, I received this error in the console.
C:\Python27\python.exe C:/Users/user/PycharmProjects/seleniumTest/test/test310.py
Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/seleniumTest/test/test310.py", line 18, in <module>
for post in posts:
TypeError: 'NoneType' object is not iterable
