我正在尝试使用 R 和 SelectorGadget 中的 rvest 包从 Glassdoor 中提取单个评级(API 仅提供汇总评级)来识别我的 CSS 选择器。
问题是 Glassdoor 使用图像来传达评级,但数字评级包含在图像标题中。使用 SelectorGadget,我可以从下面的代码片段中抓取“Comp & Benefits”文本(使用“#EmployerReviews undecorated li”),但我无法到达 span...title= 部分中的“2.0”,其中是我想要的。
<div id='EmployerReviews'> .... <ul class='undecorated'> <li> <div class='minor'>Comp & Benefits</div> <span class='notranslate notranslate_title gdBars gdRatings med ' title="2.0">
任何人过去都成功地抓取了图像标题,或者知道获得这些个人评级的另一种方法?