Selenium using Python – Geckodriver executable needs to be in PATH

selenium.common.exceptions.WebDriverException: Message: ‘geckodriver’ executable needs to be in PATH. First of all you will need to download latest executable geckodriver from here to run latest Firefox using Selenium Actually, the Selenium client bindings tries to locate the geckodriver executable from the system PATH. You will need to add the directory containing the executable to the system path. On … Read more

The tilde operator in Python

It is a unary operator (taking a single argument) that is borrowed from C, where all data types are just different ways of interpreting bytes. It is the “invert” or “complement” operation, in which all the bits of the input data are reversed. In Python, for integers, the bits of the twos-complement representation of the integer are … Read more

keyerror 1 in my code

Your main problem is this line: You think you’re making a copy of the dictionary, but actually you still have just one dictionary, so operations on dicta also change aDict (and so, you remove values from adict, they also get removed from aDict, and so you get your KeyError). One solution would be (You should … Read more

xlrd.biffh.XLRDError: Excel xlsx file; not supported

As noted in the release email, linked to from the release tweet and noted in large orange warning that appears on the front page of the documentation, and less orange, but still present, in the readme on the repository and the release on pypi: xlrd has explicitly removed support for anything other than xls files. In your case, the solution is to: … Read more

Python setup.py develop vs install

python setup.py install is used to install (typically third party) packages that you’re not going to develop/modify/debug yourself. For your own stuff, you want to first install your package and then be able to frequently edit the code without having to re-install the package every time — and that is exactly what python setup.py develop does: it installs the package … Read more

Running Selenium with Headless Chrome Webdriver

To run chrome-headless just add –headless via chrome_options.add_argument, i.e.: So my thought is that running it with headless chrome would make my script faster. Try using chrome options like –disable-extensions or –disable-gpu and benchmark it, but I wouldn’t count with much improvement. References: headless-chrome Note: As of today, when running chrome headless on Windows., you should include the  –disable-gpu flag See crbug.com/737678