Closed igorkofman closed 5 years ago
Hi @igorkofman, thanks for bringing this to my attention. This is the result of adding .encode('utf-8')
as raised in another issue here: #2.
I've been searching for a solution for this but have been unable to find something that works nicely with both Python 2 and Python 3. One work around I can think of right now would be to check if the Python language is >= 3 then cast the byte as string and slice the first 2 and last characters.
I am sure there's a much better solution for this. Any ideas?
I ended up just hitting up the underlying JSON data source since the html table only has the top 13 candidates and I wanted them all.
On Thu, Jul 18, 2019 at 4:49 AM Anthony Bloomer notifications@github.com wrote:
Hi @igorkofman https://github.com/igorkofman, thanks for bringing this to my attention. This is the result of adding .encode('utf-8') as raised in another issue here: #2 https://github.com/AnthonyBloomer/rcp/issues/2 .
I've been searching for a solution for this but have been unable to find something that works nicely with both Python 2 and Python 3. One work around I can think of right now would be to check if the Python language is
= 3 then cast the byte as string and slice the first 2 and last characters.
I am sure there's a much better solution for this. Any ideas?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AnthonyBloomer/rcp/issues/3?email_source=notifications&email_token=AADSWQQTZ4IJZHNKLN5WLMDQABKGPA5CNFSM4IEI3D7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2IHHNI#issuecomment-512783285, or mute the thread https://github.com/notifications/unsubscribe-auth/AADSWQQC7W5OS7IOU5BEJKLQABKGPANCNFSM4IEI3D7A .
With python3: b'Politico/Morning ConsultPolitico',b'4/15 - 4/21',b'30',b'24',b'7',b'8',b'9',b'6',b'2',b'4',b'1',b'2',b'1',b'0',b'--',b'Biden +6' b'EmersonEmerson',b'4/11 - 4/14',b'24',b'29',b'7',b'8',b'9',b'8',b'3',b'2',b'1',b'1',b'3',b'--',b'--',b'Sanders +5' b'Politico/Morning ConsultPolitico',b'4/8 - 4/14',b'31',b'23',b'7',b'9',b'7',b'8',b'1',b'4',b'1',b'2',b'1',b'1',b'--',b'Biden +8'
With python2: Politico/Morning ConsultPolitico,4/15 - 4/21,30,24,7,8,9,6,2,4,1,2,1,0,--,Biden +6 EmersonEmerson,4/11 - 4/14,24,29,7,8,9,8,3,2,1,1,3,--,--,Sanders +5 Politico/Morning ConsultPolitico,4/8 - 4/14,31,23,7,9,7,8,1,4,1,2,1,1,--,Biden +8