【问题标题】:Can't get all elements无法获取所有元素
【发布时间】:2017-01-08 19:26:58
【问题描述】:

https://www.whoscored.com/Regions/252/Tournaments/2/Seasons/6335/Stages/13796/Fixtures/England-Premier-League-2016-2017

尝试使用“匹配报告”(//*[@id="tournament-fixture"]/tbody/tr[2]/td[7]/a[1]) 捕获每个项目的 ID。我可以通过源代码访问可见的,但该站点使用 Incapsula,所以我无法使用请求,我目前正在使用 selenium。我想访问前几个月,当我按下后退按钮时,它会重新加载以前的装置,但源代码不会更新。

是否有人知道使用 selenium 获取上个月的源代码 (DataStore.prime),或者如何提交成功的请求以收集该特定赛季的所有赛程?

【问题讨论】:

    标签: javascript python selenium beautifulsoup


    【解决方案1】:

    无需使用 selenium,可以通过 Chrome Dev tools 中的 url 访问月份数据:

    https://www.whoscored.com/tournamentsfeed/13796/Fixtures/?d=201611&isAggregate=false
    

    ?d是年+月,比你得到一个列表中的所有数据,第一个值是id,你可以通过id得到Match Report

    https://www.whoscored.com/Matches/1080595/MatchReport
                                      ^^^^id^^
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-07
      • 1970-01-01
      • 2016-01-10
      • 2014-09-07
      • 2016-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多