edgebips / baskets

Break down ETFs and report aggregated exposure to individual instruments
16 stars 5 forks source link

AttributeError: 'Options' object has no attribute 'set_headless' when running baskets.updatedb #4

Open bdvir opened 6 months ago

bdvir commented 6 months ago

I'm trying to use the baskets.updatedb command. However, I'm encountering an error, is the project still being maintained? it seems that the code related to selenium should be updated...

Steps to Reproduce:

  1. Installed Python dependencies with pip.
  2. Cloned the baskets repository and installed it.
  3. Attempted to run python3 -m baskets.updatedb portfolio.csv.

I'm using Python 3.10.12 on Ubuntu 22.04.3 LTS.

Running

pip install requests xlrd openpyxl selenium networkx numpy pandas pytest
git clone http://github.com/blais/baskets
cd baskets
python3 -m pip install .

Finished succsessfully.

But running:

python3 -m baskets.updatedb portfolio.csv

Raised an error AttributeError: 'Options' object has no attribute 'set_headless' (and later, TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path'), I modified baskets/driverlib.py:

    # opts.set_headless(headless)
    if headless:
      opts.add_argument("--headless")

    # driver = webdriver.Chrome(executable_path=driver_exec, options=opts)
    driver = webdriver.Chrome(options=opts)

But another error raised...

blais commented 6 months ago

Project has rotted for a long time and not being actively maintained. Needs to get rewritten using petl, probably.

bdvir commented 6 months ago

ok, thanks for letting me know :)