I am trying to read a web page and save it in a .html file. The problem is
that the web page is GB-2312 encoded, and I want to save it to the file with
the same encoding or unicode. I have some code like this:
url = 'http://blah/'
headers = { 'User-Agent' : 'Mozilla/4.0 (compatible; MSIE
You must be right, since I tried one page and it worked. But there is
something wrong with this particular page:
http://overseas.btchina.net/?categoryid=-1. When I open the saved file (with
IE7), it is all messed up.
url = 'http://overseas.btchina.net/?categoryid=-1'
headers = { 'User-A
I "view sourced" the original web page in IE7, and it does specify:
So sounds like the encoding is gb2312...
--
http://mail.python.org/mailman/listinfo/python-list
One bad design about elementtree is that it has different ways parsing a
string and a file, even worse they return different objects:
1) When you parse a file, you can simply call parse, which returns a
elementtree, on which you can then apply xpath;
2) To parse a string (xml section), you can ca
. You
didn't understand the issue I described? That's your issue. You are not at
the same level to talk to me, so chill.
===
"Stefan Behnel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
To be preise, XPath is not fully supported. Don't be a smart asshole.
=
"Stefan Behnel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Peter Pei wrote:
>> One bad design about elemen
To answer something posted deep down... It is fine with me if there are two
functions - one to parse a file or file handler and one to parse a string,
yet the returned objects should be consistent.
--
http://mail.python.org/mailman/listinfo/python-list
I am using things like "%-20s%-60s%-10s" in tkinter listbox to make it look
like a table, with mono sized font like lucie system. But this does not work
with data contains "Les misérables", because it is unicode, and one byte is
not neccessary one character. Now how can I resolve this issue?
My
I probably should mention that what I want is to make all parts of the
string aligned, and look like table. I am not looking for other ways to make
it table-alike, but only interested in making % work with unicode -counting
characters not bytes...
--
http://mail.python.org/mailman/listinfo/pytho
on't argue back and I am only interested in answers from those who
are qualified.
==
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sun, 27 Jan 2008 04:06:45 +,
I just sorted posts by from, and figured out that you are kind of PSF guy...
However that does not make you qualified, I care whether you are capable not
whether you have the time to spend for PSF.
Adios!
==
"Peter Pei" <[EMAIL PROTECT
For sure I can calculate the number of characters and do the padding myself,
but what's the point, and i surely hope that python does it for me.
====
"Peter Pei" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I am using things like "%-20s%-60
"I V" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote:
>> Yes, it is true that %s already support unicode, and I did not
>> contradict that. But it counts the number of bytes instead of
>> ch
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote:
>
>> You didn't understand my question, but thanks any way.
>>
>> Yes, it is true that %s already support unicod
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote:
>
>> You didn't understand my question, but thanks any way.
>>
>> Yes, it is true that %s already
In one of my program, I used something called MultiColumnList, which is one
of the sortable table widgets done in python. However 3.0 sort is different.
I googled and found couple of other implementations, but all in python
3.0 -.
Does anyone know any solution in 3.0? or anything that has alre
16 matches
Mail list logo