-1

I need to capture all the html code within a frame in a webpage, all the data seems to be within a class as follow:

<div class="productos-mant">

Within this class you can find all the items like

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

Is any method that allow me to catpure to a .txt all the html info from this class in the frame?

thanks!

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
FC_J
  • 53
  • 1
  • 6

1 Answers1

0

You asked for all the html code within a frame in a webpage. First, call the switchTo() method using frame name or id, e.g.

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

You can find a detailed discussion here. Once you are within the intended frame, you can grab the entire HTML using getPageSource().

System.out.println(driver.getPageSource());
JeffC
  • 22,180
  • 5
  • 32
  • 55
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • there isn´t a frame name or id, the html data is inside the class, the only way to capture is with copy outerhtml option, is there any method to get it? – FC_J Jan 30 '18 at 14:51
  • @FC_Javier Yes, there are ways to do that even. Can you please raise a new Question with your new requirement please? We will be happy to help you out. – undetected Selenium Jan 30 '18 at 15:43