python


Unicode Encode Error while using mechanize to log in to website


I am using mechanize to log into website https://www.patientslikeme.com but I get the error:
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2713' in position 0: ordinal not in range(128).
Please reply how can this be resolved.
Code:
import mechanize
import cookielib
br = mechanize.Browser()
br.set_handle_robots( False )
cj = cookielib.LWPCookieJar()
br.set_cookiejar(cj)
br.addheaders = [('User-agent', 'Firefox')]
br.open('https://www.patientslikeme.com/users/sign_in')
br.select_form( nr=1)
br['user[email_or_login]'] = 'divyat'
br['user[password]']= 'nothing'
logged_in= br.submit()
logincheck= logged_in.read()
Error is caused by the line logged_in= br.submit()


Related Links

Formatting string to certain character limit in Python
Python Django return unique save dates and filter model objects
Moved time zones now datetime.utcnow() is incorrect
Pybind11 Type Error
Problems with the screen manager of Kivy Python
python selenium get asp-classic element
pip install requirements.txt issue when deploying Django app on Heroku
How to run a Python shell in azure app service
When does Python decode a byte string while reading a file?
Wordnet synset - strange list index out of range Error
python subprocess, No such file or directory
c mmap write long to mmaped-area
ModelForm has no model class specified when use model forms
python scipy load mat file error
How can i make a time counter using QTime()
How do I convert this string to an array with all the proper formatting? [duplicate]

Categories

HOME
paypal
crystal-reports
security
jenkins-plugins
admin-on-rest
elixir
npm
xamarin.android
jsviews
thunderbird-addon
rocketmq
azureservicebus
rebol
openwrt
packer
uiactivityviewcontroller
criteria
powershell-v3.0
game-maker-studio-1.4
maxima
rebol2
rapidjson
pdo
attask
multiple-columns
jconsole
plsqldeveloper
deb
scalaz7
qsub
nmf
mangodb
datadog
pygooglechart
red-black-tree
read-write
phpspreadsheet
von-neumann
hashcat
parent
intellij-idea-2016
web-development-server
ical-dotnet
mediawiki-extensions
control-flow-graph
crop
amd
tableau-server
ideone
production-environment
shutdown
react-native-fbsdk
master
rstudio-server
ruby-2.0
instruments
windows-nt
multilingual-app-toolkit
supportmapfragment
servlet-3.0
datainputstream
jenkins-scriptler
enyo
kendo-menu
divide-by-zero
web-component-tester
kendo-mvvm
qtestlib
dmp
suffix-array
power-law
coin-flipping
osx-snow-leopard
layered
onselect
dynamic-binding
visual-studio-2003
lame
lync-server-2010
autostart
plone-funnelweb
parameterization
path-manipulation
handwriting
sendfile
email-spec
multibyte-functions
web-statistics
lazy-c++
dotproject
cots





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android


MS Developer
developer works
python
ios
c
html
jquery


RDBMS discuss