leonidessaguisagjr / webdriverdownloader

Python module to facilitate downloading and deploying WebDriver binaries. Currently supporting geckodriver, chromedriver and operachromiumdriver.
https://pypi.org/project/webdriverdownloader/
MIT License
20 stars 17 forks source link

fixed bug to download geckodriver on linux 64bit #12

Closed LeydenJar closed 10 months ago

LeydenJar commented 4 years ago

So, Even after filtering for the filenames wich matches linux os and that are 64 bit, the list filename still had 2 elements on it.

One was something like 'geckodriver-version.tar.gz' and the other was 'geckodriver-version.tar.gz.asc'

So this was making me fall into that exception

if len(filename) != 1: info_message = "Error, unable to determine correct filename for {0}bit {1}".format(bitness, os_name) logger.error(info_message)

So i just added this filtering to remove anything ending in asc from the filename list. Looks like it should be consistent

elissonnog commented 4 years ago

Could you be more specific where I have to change? I dont really understand.

paqio commented 4 years ago

Could you be more specific where I have to change? I dont really understand.

https://github.com/leonidessaguisagjr/webdriverdownloader/pull/12/commits/a47a57c3a3ff20d81178989149946b6c128d46c8

LeydenJar commented 4 years ago

@elissonnog

On the webdriverdownloader.py you change the line 320 from filename = [name for name in filenames if os_name + bitness in name] to filename = [name for name in filenames if os_name + bitness in name and name[-3:] != 'asc' ]

LeydenJar commented 4 years ago

A consideration: Maybe we should do something like

filename = [name for name in filenames if os_name + bitness in name and name[-7:] == '.tar.gz' ]

this seems slightly more consistent. Not a big deal tho...

nupator commented 4 years ago

it says "that i dont have permission to edit this file" i tried to sudo gedit ~/usr/lib..../webdriverdownloader it opened a space so i can type but the file isnt there. so i pasted the code from there to the new file but it says that the location doesnt even exist. lol help me pls. XD new to ubuntu and stuff. @LeydenJar anyone?

LeydenJar commented 4 years ago

@nupator try pasting this in the command line

pip show webdriverdownloader

this will give you some information about the webdriverdownloader package, including the path where it's located.

nupator commented 4 years ago

WARNING: Package(s) not found: webdriverinstaller

nupator commented 4 years ago

@LeydenJar ley

nupator commented 4 years ago

Also if i did pip install webdriverdownloader it shows me thisimage

LeydenJar commented 4 years ago

@nupator looks like the package is installed on /usr/local/lib/python3.8/dist-packages/

Try to go there and use the ls command to see what's in there. Maybe navigating like this you can find the file. Also don't forget to add ".py" at the end of the file name.

you want to do something like sudo nano /path/to/file/filename.py

I just wonder why pip show doesn't give you anything. Maybe you have conflicts between different pips. Are you using a virtual environment? Maybe you should consider it.

nupator commented 4 years ago
Screen Shot 2020-09-13 at 4 06 26 PM Screen Shot 2020-09-13 at 4 07 16 PM

yes this is a virtual machine. no such file or directory. so i did the nano but for /usr/local/lib/python3.8/dist-packages/ only

nupator commented 4 years ago

@LeydenJar đź‘Ť

LeydenJar commented 4 years ago

@nupator ok so, the cd command should be used to change the directory. As you specified the path to a .py file, it won't work cause it's a .py file and not a directory.

Try to cd on /usr/local/lib/......./dist-packages, then use the ls command to see if you can see the webdriverdownloader.py there.

If it is you should be able to use something like sudo nano webdriverdownloader.py and make the edits.

Eduardovalenca commented 4 years ago

Can someone help me please? mine still doesn't work, I tried to make the change that the friend above said but it's still the same Captura de tela de 2020-10-10 10-38-10

JacoSant commented 4 years ago

Can someone help me please? mine still doesn't work, I tried to make the change that the friend above said but it's still the same Captura de tela de 2020-10-10 10-38-10

Hi, you have resolve this? if yes how? i've try all things that the other people above said...

Venkateshvenki404224 commented 3 years ago

@elissonnog

On the webdriverdownloader.py you change the line 320 from filename = [name for name in filenames if os_name + bitness in name] to filename = [name for name in filenames if os_name + bitness in name and name[-3:] != 'asc' ]

I couldn’t find the similar code on line 320 it’s some other code their

    filename = filename[0]

    result = json_data['assets'][filenames.index(filename)]['browser_download_url']
    logger.info("Download URL: {0}".format(result))
    return result