Linked Questions

0 votes
0 answers
1k views

I'm trying to do some parsing with BeautifulSoup: from bs4 import BeautifulSoup import requests import lxml r = requests.get('https://pythonprogramming.net/parsememcparseface/') page_text = r.text....
Maxxer's user avatar
  • 130
0 votes
1 answer
212 views

We have this function which takes care of special character. For example this function will convert He shouldn’t be allowed to He shouldn�t be allowed. import io.circe._, io.circe.generic.auto._, io....
curiousguy's user avatar
  • 3,282
14 votes
2 answers
29k views

Possible Duplicate: Python UnicodeDecodeError - Am I misunderstanding encode? I have a string that I'm trying to make safe for the unicode() function: >>> s = " foo “bar bar ” weasel" &...
Nick Heiner's user avatar
17 votes
2 answers
35k views

It's my 2nd day with Selenium 2 library and the pain with Unicode never seem to subside. I'm just doing the most basic operation, want to print the page source: from selenium import webdriver driver ...
nutship's user avatar
  • 4,934
2 votes
5 answers
5k views

This code should write some text to file. When I'm trying to write my text to console, everything works. But when I try to write the text into the file, I get UnicodeEncodeError. I know, that this is ...
Milano's user avatar
  • 18.9k
7 votes
2 answers
2k views

I use cmd Windows, chcp 65001, this is my code: print u'\u0110 \u0110' + '\n' Result: (a character cmd can't display) (character what i want) Traceback (most recent call last): File "b.py", ...
pc43's user avatar
  • 457
3 votes
1 answer
5k views

I see that the Python manual mentions .encode() and .decode() string methods. Playing around on the Python CLI I see that I can create unicode strings u'hello' with a different datatype than a '...
dotancohen's user avatar
  • 31.8k
2 votes
1 answer
5k views

I keep getting an error when trying to display content from an rss feed. the feeds I have tried are the Teksyndicate "kitchen sink" feed(utf-8) and the AMD news feed(encoding not set), both downloaded ...
Termanater13's user avatar
1 vote
1 answer
2k views

I'm fairly new to Python, so I'm hoping this is something simple that I'm just missing. I'm running Python 2.7 on Windows 7 I'm trying to run a basic twitter scraping program through the command ...
seth127's user avatar
  • 2,784
0 votes
2 answers
2k views

I have a pandas dataframe (python 2.7) containing a u'\u2019' that does not let me extract as csv my result. UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 180: ...
Blue Moon's user avatar
  • 4,791
2 votes
1 answer
2k views

I am a beginner to Python and am currently parsing a web-based XML file from the eventful.com API however, I am receiving some unicode errors when retrieving certain elements of the data. I am able ...
Karen's user avatar
  • 2,579
-2 votes
2 answers
2k views

#python 3 version ... #關於產地 ... crop = '牛蒡' ... #要求輸入資料 def rundatainputcircle(): marketinput = input('*請擇一輸入: 1:台北一, 2:台北二, 3:三重市, 4:台中市, 5:高雄市, 6:鳳山市, 7:桃園縣 或是不填寫 > ') if ...
JTLee's user avatar
  • 99
2 votes
1 answer
922 views

I am saving MS Access tables as CSV files using Python. There is a table in the MS Access database that is named 'Perm_Site Info'. There is a space in the naming in MS Access. When I run the below ...
user avatar
3 votes
1 answer
1k views

I have downloaded Stackoverflow June 2013 data dump and now in the process of parsing the XML files and storing in MySQL database. I am using Python ElementTree to do it and it keeps crashing and ...
RWS's user avatar
  • 31
0 votes
1 answer
1k views

Working on Ubuntu 16.04, python 2.7.12, I have this code (codec.py): #!usr/bin/env python # -*- coding: utf-8 -*- import codecs text = u'pi: \u03c0' print text Start program with: python codec.py ...
popad's user avatar
  • 13

15 30 50 per page