How to install Chrome Extension using Selenium & Python

前端 未结 1 619
谎友^
谎友^ 2020-12-04 01:08

Hello I\'m trying to install a Chrome extension with Selenium using python, I tried using ChromeDriver - WebDriver for Chrome

But it is not working, this is my code

相关标签:
1条回答
  • 2020-12-04 01:25

    To add/install the DS-Amazon-Quick-View Chrome extension using Selenium's python client you can use the following splution:

    • Code Block:

      from selenium import webdriver
      from selenium.webdriver.chrome.options import Options
      
      chrome_options = Options()
      chrome_options.add_extension('/home/daniel/amazon-project-scrapers/chromedriver_linux64/DS-Amazon-Quick-View_v2.8.9.crx')
      driver = webdriver.Chrome(options=chrome_options, executable_path='/path/to/chromedriver')
      driver.get('https://www.google.co.in')
      

    Reference

    You can find a couple of relevant discussions in:

    • [Python] How to load extension within chrome driver in selenium with python
    • [Java] How to install extension permanently in geckodriver
    0 讨论(0)
提交回复
热议问题