Selenium 连接一个已有的连接


  • 先启动一个Driver和Session,并且打印出连接的URL和Session
url = driver.command_executor._url       #""
session_id = driver.session_id            #'4e167f26-dc1d-4f51-a207-f761eaf73c31'
  • 然后再连接过去
driver = webdriver.Remote(command_executor=url,desired_capabilities={})
driver.session_id = session_id

Stackoverflow: Connect to an already running instance of chrome using selenium in python

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.