I want to scrape the review from Sephora website. The review is dynamically updated.
After inspection I found the review is here in the HTML code.
<div class="css-eq4i08 " data-comp="Ellipsis Box">Honestly I never write
reviews but this is a must if you have frizzy after even after straightening
it! It smells fantastic and it works wonders definitely will be restocking once
I’m done this one !!</div>
I want to write a python selenium code to read the review.
The code I wrote is here...
from selenium import webdriver
chrome_path = (r"C:/Users/Connectm/Downloads/chromedriver.exe")
driver = webdriver.Chrome(chrome_path)
driver.implicitly_wait(20)
driver.get("https://www.sephora.com/product/crybaby-coconut-oil-shine-serum-P439093?skuId=2122083&icid2=just%20arrived:p439093")
reviews = driver.find_element_by_xpath('//*[@id="ratings-reviews"]/div[4]/div[2]/div[2]/div[1]/div[3][@data-comp()='Elipsis Box'])
print(reviews.text)
If I write find_element_by_class
it gives me blank.
What is the best option?
I am trying to use xpath with attribute. The code is not working. Someone please help me on what is the best solution?