Re: How to extract contents of inner text of html tag?

2014-06-27 Thread Jesse Adam
I don't have BeautifulSoup installed so I am unable to tell whether a) for line in all_kbd: processes one line at a time as given in the input, or do you get the clean text in single lines in a list as shown in the example in the doc

Re: How to extract contents of inner text of html tag?

2014-03-08 Thread Jason Friedman
for line in all_kbd: if line.string == None: I modified your code slightly: for line in all_kbd: print(line) sys.exit() if line.string == None: Running the new script yields: $ python shibly.py kbd class=command cp -v --remove-destination /usr/share/zoneinfo/ em

How to extract contents of inner text of html tag?

2014-03-01 Thread Golam Md. Shibly
Hi, ###in.txt kbd class=command cp -v --remove-destination /usr/share/zoneinfo/ em class=replaceablecodexxx/code/em \ /etc/localtime /kbd import sys import unicodedata from bs4 import BeautifulSoup file_name=in.txt html_doc=open(file_name,'r') soup=BeautifulSoup(html_doc)