标签: pagination scrapy
我创建了一个蜘蛛,它从下表中获取信息,但我无法更改为上一个表,因为它没有" href",我该怎么做?
https://br.soccerway.com/teams/italy/as-roma/1241/
上一个没有href的按钮
<a rel="previous" class="previous " id="page_team_1_block_team_matches_summary_7_previous">« anterior</a>
答案 0 :(得分:1)
如果您在浏览器中查看网络检查器,则可以在单击下一个按钮时看到正在进行的XHR请求:
该请求返回带有html更改的json响应:
您需要对页面生成此网址的方式进行反向工程(来自第一张图片):
https://br.soccerway.com/a/block_team_matches_summary?block_id=page_team_1_block_team_matches_summary_7&callback_params=%7B%22page%22%3A0%2C%22bookmaker_urls%22%3A%7B%2213%22%3A%5B%7B%22link%22%3A%22http%3A%2F%2Fwww.bet365.com%2Fhome%2F%3Faffiliate%3D365_371546%22%2C%22name%22%3A%22Bet%20365%22%7D%5D%7D%2C%22block_service_id%22%3A%22team_summary_block_teammatchessummary%22%2C%22team_id%22%3A1241%2C%22competition_id%22%3A0%2C%22filter%22%3A%22all%22%2C%22new_design%22%3Afalse%7D&action=changePage¶ms=%7B%22page%22%3A1%7D
然后您可以使用它来检索以下页面。