我正在尝试解析一些页面,但我一无所获, 我正在使用“ pager rel clr'”类来解析“ div”块
pages=soup.find('div', class_='pager rel clr')
通过此代码,我只需要解析以下href的页面链接
https://www.olx.pl/motoryzacja/samochody/volkswagen/golf/?page=2
https://www.olx.pl/motoryzacja/samochody/volkswagen/golf/?page=3
https://www.olx.pl/motoryzacja/samochody/volkswagen/golf/?page=4
这是获取的html的不完整示例
<div class="pager rel clr">
<form action="" class="abs clr pagerGoToPage" id="pagerGoToPage" method="GET">
<span class="fnormal small fleft lheight24 pding0_5">Idź do strony:</span>
<fieldset class="fleft">
<input class="light lheight22 fleft tcenter br3 {currentPage: 1}" id="pageParam" maxlength="4" name="page" type="text" value="1"/>
<input name="search[filter_enum_model]" type="hidden" value="golf"/>
<input class="{totalPages: 219}" type="submit" value="OK"/>
</fieldset>
</form>
<span class="fbold prev abs large">
<span class="link pageNextPrev {page:0}" data-cy="page-link-prev"> <span>« poprzednia</span>
</span>
</span>
<span class="item fleft">
<span class="block br3 c41 large tdnone lheight24 current" data-cy="page-link-current"> <span>1</span>
</span>
</span>
<span class="item fleft">
<a class="block br3 brc8 large tdnone lheight24" data-cy="page-link-2" href="https://www.olx.pl/motoryzacja/samochody/volkswagen/golf/?page=2">
<span>2</span>
</a>
</span>
<span class="item fleft">
<a class="block br3 brc8 large tdnone lheight24" data-cy="page-link-3" href="https://www.olx.pl/motoryzacja/samochody/volkswagen/golf/?page=3">
<span>3</span>
</a>
</span>
<span class="item fleft">
<a class="block br3 brc8 large tdnone lheight24" data-cy="page-link-4" href="https://www.olx.pl/motoryzacja/samochody/volkswagen/golf/?page=4">
<span>4</span>
</a>
答案 0 :(得分:0)
如果我看清所有内容,一旦您将所有标签都做成漂亮的汤,就可以做类似的事情
NuSMV:command not found