尝试使用 soapui 和 selenium 在 class 中捕获 html 代码

Trying to capture html code within a class with soapui and selenium

我需要捕获网页中一个框架内的所有 html 代码,所有数据似乎都在一个 class 内,如下所示:

<div class="productos-mant">

在此 class 中,您可以找到

等所有项目
<a class="round-item" href="https://www.supermercado.com/my-basket/profile" data-id ...etc</a>

是否有任何方法可以让我将框架中此 class 中的所有 html 信息捕获为 .txt?

谢谢!

您要求all the html code within a frame in a webpage。首先,使用框架名称或 ID 调用 switchTo() 方法,例如

driver.switchTo().frame("frame_name");
driver.switchTo().frame("frame_id");

你可以找到详细的讨论here。一旦你在预期的框架内,你可以使用 getPageSource().

抓取整个 HTML
System.out.println(driver.getPageSource());