Selenium is a web automation framework that can be used to automate website testing. Because Selenium starts a webbrowser, it can do any task you would normally do on the web.
If you are new to selenium and browser automation, I recommend the course below.
MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments. Click the product pictures below to access and securely download the latest product software updates. To view the latest product flyers, manuals, quickstart guides, pinouts and informational documents, visit the Document Page. The PyMongo distribution contains tools for interacting with MongoDB database from Python. The bson package is an implementation of the BSON format for Python. The pymongo package is a native Python driver for MongoDB. The gridfs package is a gridfs implementation on top of pymongo.
Related course
Browser Automation with Python Selenium
Web Driver
To start a web browser, the Selenium module needs a web driver. Python interacts with the selenium web driver and the web driver interacts with the browser.
Supported browsers are:
- Chrome
- Firefox
- Internet Explorer
- Safari
- Opera
- PhantomJS (invisible)
To start a browser, you will need to corresponding web driver. The driver “ChromeDriver” is needed to start Chrome, “FirefoxDriver” for Firefox.
All drivers can be downloaded from: https://docs.seleniumhq.org/download/
Example code
Python will start and control the chromium browser using the code below:
You can change the browser by creating a different instance:
The first two lines in the above code will open the browser on the same computer, the others lines open the browser remotely: on a phone.
Then open a webpage using the get() method:
The CH340 chip is used by a number of Arduino compatible boards to provide USB connectivity, you may need to install a driver, don’t panic, it’s easier than falling off a log, and much less painful.
Windows
(Manufacturer’s Chinese Info Link)
- Download the Windows CH340 Driver
- Unzip the file
- Run the installer which you unzipped
- In the Arduino IDE when the CH340 is connected you will see a COM Port in the Tools > Serial Port menu, the COM number for your device may vary depending on your system.
Older Windows Driver Version and Instructions
Download the Windows CH340 DriverUnzip the folder.If you are running a 64Bit Windows: – run the SETUP_64.EXE installer.If you are running a 32Bit Windows: – run the SETUP_32.EXE installer.If you don’t know, try the 64 bit and if it doesn’t work, the 32 bit.In the Arduino IDE when the CH340 is connected you will see a COM Port in the Tools > Serial Port menu, the COM number for your device may vary depending on your system.
Macintosh
(Manufacturer’s Chinese Info Link)
The following github has up to day pkg files for 1.3, 1.4 and 1.5 at time of writing, thanks to Joshua Wallis for bringing this to my attention…
Direct Download Links (from the github repo above):
See the github link above for installation instructions if you need them.
Previous macinstosh downloads if the above doesn’t work for you…
(V1.3) Download the CH340 Macintosh Signed Driver for Mavericks (10.9), Yosemite (10.10) and El Capitan (10.11) and Sierra (10.12)
Inside the zip file you will find a PDF and a “pkg” file, short version, double click the pkg file, the PDF has some extra information.
OSX Sierra (10.12) Note
A kindly user, Maarten Segers reports
FYI, the driver documented here WILL crash on OSX Sierra.
I can personally not test on MacOS and can not vouch for the above drivers at github, but there you go.
See uninstalling information at the bottom of the page if the driver causes problems for you.
Here is an older version of the Mac driver, NOT FOR 10.12 Sierra
(V1.0) Download the CH340 Macintosh Signed Driver for Mavericks (10.9), Yosemite (10.10) and El Capitan (10.11)
Linux
(Manufacturer’s Chinese Info Link)
Drivers are almost certainly built into your Linux kernel already and it will probably just work as soon as you plug it in. If not you can download the Linux CH340 Driver (but I’d recommend just upgrading your Linux install so that you get the “built in” one).
Uninstalling From Macinstosh
Python Driver Download For Windows 8.1
A couple of Mac users have said “the driver crashes my mac Sierra how do I uninstall”.
Firstly regards the crash make sure you installed the 1.3 version of the driver, not the old one. You could download it directly from the Manufacturers Website in case they have issued an update since I wrote this page.
Python Driver Download For Windows Offline
Python Driver Download For Windows Xp
Secondly a quick google search reveals that this is how you uninstall:
Phyton Driver Download For Windows
- Open a terminal and type:
cd /Library/Extensions/
- Verify that the .kext file is present:
ls | grep usbserial.kext
- Output should be:
usbserial.kext
- Then type:
sudo rm -R usbserial.kext
- Verify that the .kext file has been removed:
ls | grep usbserial.kext
- Output should be empty.
- After you should remove the files stored in receipts folder:
cd /private/var/db/receipts/
- Find the enties:
ls | grep usbserial*
- Output should be:
codebender.cc.ch34xinstaller.usbserial.pkg.bom codebender.cc.ch34xinstaller.usbserial.pkg.plist
- Remove each one of the files of the above list:
sudo rm -r
filename
`