硒可以模拟单击而无需加载链接?

发布于 2025-02-11 13:10:15 字数 735 浏览 0 评论 0原文

我正在研究一个试图自主监视Angular网站上的商品价格的项目。

这是与特定物品的链接:

https://www.< site-name&gt; .com/categories/categories/&lt sub-category&gt;/products?prodnum = 99999999

使用Selenium使用Selenium (在Python中)在带有产品列表的页面上,我可以获得有关项目的一些有用信息,但是我真正想要的是prodnum参数。 onclick项目的属性= clickonItem(item,$ index)。 我确实有一些有关项目的信息信息,包括item$ index值在HTML中可见,但是我怀疑有一种方法可以看到一种方法可以查看实际是什么发生在ClickOnItem中。

我尝试使用Dev-Tool四处寻找ClickOnItem定义的位置,但我还没有成功。

考虑到我看不到任何方法可以获取prodnum而无需单击,我想知道,有一种方法可以模拟单击以查看将其重定向到的位置,但没有实际加载链接 - 因为这会花太多时间来为每个项目做吗?

注意:我想获得特定的prodnumber。我希望能够直接访问项目页面,而无需首先使用主列表页面。

I'm working on a project trying to autonomously monitor item prices on an Angular website.

Here's what a link to a particular item would look like:

https://www.<site-name>.com/categories/<sub-category>/products?prodNum=9999999

Using Selenium (in Python) on a page with product listings, I can get some useful information about the items, but what I really want is the prodNum parameter.
The onClick attribute for the items = clickOnItem(item, $index).
I do have some information for items including the presumable item and $index values which are visible within the html, but I'm doubtful there is a way of seeing what is actually happening in clickOnItem.

I've tried looking around using dev-tools to find where clickOnItem is defined, but I haven't been successful.

Considering that I don't see any way of getting prodNum without clicking, I'm wondering, is there's a way I could simulate a click to see where it would redirect to, but without actually loading the link- as this would take way too much time to do for each item?

Note: I want to get the specific prodNumber. I want to be able to hit the item page directly without first going though the main listing page.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文