JavaScript:网站删除数据表时,网站过滤时不要更改网站元素中的任何内容

发布于 2025-02-05 14:06:33 字数 347 浏览 3 评论 0原文

我正在此网站上的“评分领导者”表中删除数据: http://www.saahl.ca/leagues/stats_hockey.cfm?clientid=6601&

;通过检查表。问题是我还想刮擦前几年数据。您可以使用网站上表上方的下拉菜单选择前几年,然后出现在屏幕上。但是,当您选择上一年时,URL不会改变,也没有任何内部检查(我可以看到)。 HTML元素的内部文字发生了变化,但我无法识别。

有什么办法可以隔离一些不同的东西以瞄准刮擦?

I am scraping the data from the "Scoring Leaders" table on this website: http://www.saahl.ca/leagues/stats_hockey.cfm?clientid=6601&leagueid=30336

I've successfully scraped the data using JS, having identified the #leaders ID on the elements in the table through Inspect. The trouble is that I want to also scrape previous years data. You can select previous years using the dropdown menu above the table on the site and they show up on screen. However, when you select a previous year, the URL doesn't change, nor does anything inside inspect (that I can see). The inner text of the HTML elements changes, but nothing else that I can identify.

Is there any way to isolate something different for the scrape to target?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黎夕旧梦 2025-02-12 14:06:33

您可以在下拉列表中使用选定的值作为标识符,

然后删除2021/2022 U15常规季的数据:

const trs = document.querySelectorAll(['tr.odd', 'tr.even'])

NOW TRS [0]包含:

”

您更改选择中的值到2020/2021 U15常规季:

您的查询要比以前相同:

const trs = document.querySelectorAll(['tr.odd', 'tr.even'])

现在TRS [0]包含:

You could use the selected value in the dropdown as identifier

You go to the url and scrape the data for 2021 / 2022 U15 Regular Season:

const trs = document.querySelectorAll(['tr.odd', 'tr.even'])

Now trs[0] contains:

Results for first row

You change the value in the select to 2020 / 2021 U15 Regular Season:

You perform the same query than before:

const trs = document.querySelectorAll(['tr.odd', 'tr.even'])

Now trs[0] contains:

Results for first row

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文