使用scray,如何从sciencedirect.com生成的任何结果页导航到“nextpage”链接?在
nextpage链接是输入元素:
<div class="paginationBar">
<span style="color:#A4A4A4;" aria-disabled="true" alt="Previous Page" title="Previous Page"><< Previous</span>
<span class="pageText">Page 1 of 20462</span>
<input class="nextPrev" type="submit" title="Next Page" alt="Next Page" name="bottomNext" onmouseout="this. className='nextPrev'" onmouseover="this.className='nextPrevHov'" value="Next >>">
</div>
并且存在一些javascript,但我不知道如何使用它:(
答案很简单:不涉及JavaScript。在
如果你看一下这个站点,你会发现链接
Next >>
是一个input
字段,submit
是form
。在当查看}与Scrapy一起刮下一个站点。在
form
本身时,您可以看到它向站点发送get
请求。这个请求的input
字段可以聚集在一起,然后yield
一个新的{例如:
当然,需要一些错误处理(例如,在1000个结果之后,您无法查看更多结果,因此您将得到一个没有
form
的错误站点)。在相关问题 更多 >
编程相关推荐