How can I login to a website with Python?

Maybe you want to use twill. It’s quite easy to use and should be able to do what you want. It will look like the following: from twill.commands import * go(‘http://example.org’) fv(“1”, “email-email”, “blabla.com”) fv(“1”, “password-clear”, “testpass”) submit(‘0’) You can use showforms() to list all forms once you used go… to browse to the site … Read more

How to add Apache HTTP API (legacy) as compile-time dependency to build.grade for Android M?

For API 23: Top level build.gradle – /build.gradle buildscript { … dependencies { classpath ‘com.android.tools.build:gradle:1.3.1’ } } … Module specific build.gradle – /app/build.gradle android { compileSdkVersion 23 buildToolsVersion “23.0.0” useLibrary ‘org.apache.http.legacy’ … } Official docs (for preview though): http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client Latest android gradle plugin changelog: http://tools.android.com/tech-docs/new-build-system

accepting HTTPS connections with self-signed certificates

The first thing you need to do is to set the level of verification. Such levels is not so much: ALLOW_ALL_HOSTNAME_VERIFIER BROWSER_COMPATIBLE_HOSTNAME_VERIFIER STRICT_HOSTNAME_VERIFIER Although the method setHostnameVerifier() is obsolete for new library apache, but for version in Android SDK is normal. And so we take ALLOW_ALL_HOSTNAME_VERIFIER and set it in the method factory SSLSocketFactory.setHostnameVerifier(). Next, … Read more