0

i use the command

browser.get_screenshot_as_file('google2.png') 

to take pictures of my headless chrome in ubuntu server. But the pictures are from the hole page without including the console with the errors. Problem is i am trying to connect linkedin using webscraping knowledge, but it is giving me an error. So i want to see if this error appears in the console, in order to solve it.

Luiza Rodrigues
  • 185
  • 1
  • 2
  • 15
  • I don't know the exact answer, but you might find a way by looking at this answer that's close to your problem: https://stackoverflow.com/a/53026390/142780 – Neil Mar 24 '19 at 23:17
  • I believe i can open the devtools without a problem. I need to take a print screen of it using selenium – Luiza Rodrigues Mar 24 '19 at 23:20

1 Answers1

0

If you import ActionChains As well as Keys, you should be able to press F12 using the following:

actions = ActionChains(browser) 
actions.send_keys(Keys.F12).perform()

Let me know how that works for you. Action change can be flaky sometimes but there are a couple of other options we could try if this doesn’t work.

C. Peck
  • 3,641
  • 3
  • 19
  • 36