./xx.py: line 1: import: command not found

It’s not an issue related to authentication at the first step. Your import is not working. So, try writing this on first line: and for the time being run using For you here is one explanation: At first, I initialized abc variable and it works fine. On the otherhand, xyz doesn’t work as it is … Read more

Python string prints as [u’String’]

[u’ABC’] would be a one-element list of unicode strings. Beautiful Soup always produces Unicode. So you need to convert the list to a single unicode string, and then convert that to ASCII. I don’t know exaxtly how you got the one-element lists; the contents member would be a list of strings and tags, which is … Read more