Continuous syntax error and no output in my web scraping program. My xpath is correct as it is pointing to the correct names but I am not getting any output. The website is https://www.ikea.com/sa/en/search/?query=chair&pageNumber=1 . Can someone help?
I have python 3.4.4 and I am using visual studio code as a GUI. I am trying to get the item names from the IKEA website as a web scraping code. But I am continuously having the error. Can someone help?
import selenium
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait, Select
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException, WebDriverException
import csv
import os
driver= webdriver.Chrome("C:/Python34/Scripts/chromedriver.exe")
driver.get("https://www.ikea.com/sa/en/search/?query=chair&pageNumber=1")
title =driver.findElement(By.XPath("//span[@class='prodName prodNameTro']")).text()
print(title)
Expected Output:
RENBERGET
HÄRÖ / FEJAN
ÄPPLARÖ
TÄRENDÖ / ADDE
AGAM
ÄPPLARÖ
These are the names of the item on the page