1

I'm using Selenium with Python API and Chrome to do the followings:

  1. Collect the Performance Log;
  2. Click some <a, target='_blank'> tags to get into other pages;

For example, I click a href in Page 'A', which commands the browser opens a new window to load another URL 'B'.

But when I use driver.get_log('performance') to get the performance log, I can only get the log of Page 'A'. Even though I switch to the window of 'B' as soon as I click the href, some log entries of the page 'B' will be lost.

So how can I get the whole performance log of another page without setting the target of <a> to '_top'?

saeed foroughi
  • 1,662
  • 1
  • 13
  • 25
ywtsang
  • 11
  • 2

1 Answers1

0

I had the same problem and I think it is because the driver does not immediately switch to a new window.

I switched to page "B" and reloaded this page, then uses get_log and it worked.

Ruli
  • 2,592
  • 12
  • 30
  • 40
syuan
  • 1
  • 1