![](/img/trans.png)
[英]How to continuously scrape data from the DOM of a page that comes with infinite scrolling?
[英]How to search for text that comes from DOM
這是它應該如何工作。 我有一個應用程序,您必須在其中選擇一項體育活動。 目前我有一個函數 setActivityType(String: ActivityName) 將在我的數據庫中設置值。 現在我想做的是當我點擊那個按鈕時應該突出顯示點擊的按鈕。 我想在 DOM 中搜索之前傳入的 ActivityName 並選擇它,以便我可以更改它的樣式。 這是每個運動按鈕的制作方式:
<div class="type" onClick="setActivityType('Volley')">
<i class="fas fa-volleyball-ball"></i>
<p>Volley</p>
</div>
那么我怎樣才能搜索<p>Volley</p>
值呢?
我想出用event.target
來做這件事,它將獲得所有的 dom 信息,然后我想出了如何操作它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.