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

lookahead algorithm in Python
flask + gunicorn, make a redirect stick to the same worker thread
What is the difference between t_ignore, pass and t.lexer.skip() in ply.lex?
how do i pass groupby elements as lists to a function in python/pandas
Numpy argwhere inequality conditions
How CMD.exe recognize an extension need program?
How to edit data with django-tables2 in a frontend?
While loop giving different return and print results?
Trouble understanding a strange Python import
Reading the binary file shows unreadable characters
Dynamically re-sizing images in a GStreamer pipeline in python
efficient expanding linregress
Passing python dictionary to a class changes the value of dictionary [duplicate]
Convert list into correct input for polyfit [closed]
Python inheritance with super
Limiting the subquery with SQLAlchemy

Categories

HOME
visual-studio-2015
erlang
agile
docker-swarm
automated-tests
apple-numbers
defragmentation
value
simpy
spring-cloud-contract
onenote-api
structuremap
hosts
wicket
cortex-a
flann
scaling
factor-analysis
google-people
vs2017
propel2
boolean-expression
ejbca
statusbar
onsen-ui
extractor
fabric
philips-hue
continuous-deployment
pptp
fetch-api
reply
fileinfo
swiftcharts
rhomobile
reactivemongo
threshold
von-neumann
nunit-3.0
agent
productivity
lftp
php-ews
dojox.grid.datagrid
startapp
nstouchbar
sgmlreader
goquery
rhel6
crystal-reports-8.5
volume
photography
infinite-scroll
unity3d-editor
createobject
push-diffusion
radians
spoofing
instruments
spring-repositories
magento-1.4
eyeql
anti-patterns
urn
gulp-livereload
shift-jis
ticket-system
hana-xs
ultrawingrid
vcl
dache
coin-flipping
slick-2.0
mbox
reserved-words
sanitization
cling
dynamic-binding
mailcore
fluidsynth
dynamic-data
marmalade-edk
cgpath
usn
static-variables
symfony-2.0
getstring
nintendo
ubuntu-11.04
datacontract
posting
paintcomponent
authenticode
adsl
j-interop
unreachable-code
scala-2.8
act
weborb
data-execution-prevention





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm