![](/img/trans.png)
[英]How to scrape the Glassdoor Rating using Selenium and Python
[英]Cannot scrape glassdoor rating's stars
就像 Dan 在評論中解釋的那樣,您可以在 class 中找到應用的 css ( .css-1ihykkv
)。 在此 css 中,您將獲得background
中的linear-gradient
屬性。 您還可以找到用於評級的綠色和灰色的百分比。 在此處查看屏幕截圖:
一旦你找到這個 css 及其屬性,你就可以提取百分比數據。 下面分享一個關於如何提取.css
數據的示例:
bgColor = driver.findElement(By.xpath("//button[contains(@class,'btn-primary')]")).getCssValue("background-color")
print bgColor
output 應該是這樣的:
rgba(0, 123, 255, 1)
嘗試從background
屬性中提取數據,您可以將百分比數據用於不同的評級,例如文化和價值觀等。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.