print(lh[10].text.strip())
works perfectly- thank you!
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Posts made by locm
-
RE: Strip some html codes out
-
Strip some html codes out
Here is my script:
from bs4 import BeautifulSoup as soup from urllib.request import urlopen as uReq page_url = ('http://fcs002.xreflector.net/_user.html') uClient = uReq(page_url) page_soup = soup(uClient.read(), "html.parser") uClient.close lh = page_soup.findAll("td") print (lh[10])
It prints out:
<td><div align="left">WW6E </div></td>how can I end up with just the WW6E ?
Thanks,
Michael