Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of starting chrome browser by python selenium webdriver

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

No nonsense, go straight to the topic, this demonstration how to start chrome, and specify the default profile

Download chromedriver

Address: http://chromedriver.storage.googleapis.com/index.html?path=2.33/

Special note: look at notes.txt, pay attention to the version number must match ah, if the chromedriver version and your chrome version do not match, it may not start!

Actual combat code

From selenium import webdriverpath= "full path to chromedriver.exe" option=webdriver.ChromeOptions () # enter chrome://version/, in the chrome address bar to view your [profile path] option.add_argument ('--the profile path viewed above user-data-dir= is written here') driver=webdriver.Chrome (executable_path=path,chrome_options=option) # return driver

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report