Python request.get无法获取所有<div>

2024-06-16 14:56:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在通过chrome的开发者页面向https://racing.appledaily.com.hk/race-day/race-position?raceDay=1865&race=15632发出get请求,我可以看到完整的html页面。然而,当我发出get请求时,python只返回html的一部分

HTML:

<html class="gr__racinng_applledaily_com_hk" style='overflow: initial;">
<head> ... </head>
<body data-gr-c-s-loaded="true">
<!-- Google Tag Mananger (noscript) -->
<noscript> ...</noscript>
<!-- End Google Tag Mananger (noscript) -->
<div data-v-6223d6a8 id="app" class="web"> ... </div>
</body>
</html>

缺少<div data-v-6223d6a8 id="app" class="web"> ... </div>部分

使用的代码:

content = request.get('https://racing.appledaily.com.hk/race-day/race-position?raceDay=1865&race=15632')

Tags: httpsdivcomdatagethtmlpositionclass