Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法从图像列表中选择第一张图像
< a class ="image">....</a> < a class ="image">....</a> < a class ="image">....</a>
使用以下代码时,它显示所有图像的预览。我只想显示第一个的预览图像。
page.execute_script('$(".image").trigger("mouseenter")')
这段代码应该做你想做的事:
page.execute_script('$(".image:first").trigger("mouseenter")')