如何废弃Flipkart的移动评论数据
我尝试使用selenium包,但除了一篇评论外,无法一目了然地提取所有评论,所以任何人都可以帮我处理代码......
fk_path = ('[https://www.flipkart.com/moto-g-turbo-white-16-gb/product-
reviews/itmecc4uhbue7ve6?pid=MOBECC4UQTJ5QZFR][1]')
from selenium import webdriver
browser = webdriver.Chrome('/home/subhasis/chromedriver')
browser.get(fk_path)
browser.find_element_by_xpath("//span[@class='_1EPkIx']/span").click()
# Mimick clicking on 'Read More'
[p.click() for p in browser.find_elements_by_xpath("//span[@class='_1EPkIx']/span")] # Expand
all 'Read More' buttons
browser.find_element_by_xpath("//div[@class='_3DCdKt']//div[@class='qwjRop']/div").text
# Extract texts from respective Xpaths (1st review)