I have html string like that for example
<td align="left" nowrap="nowrap">John 23</td>
I want to find "John 23" between '<td align="left" nowrap="nowrap">'
and '</td>'
I want to find with Regular Expressions in python
How can I do it?
I have html string like that for example
<td align="left" nowrap="nowrap">John 23</td>
I want to find "John 23" between '<td align="left" nowrap="nowrap">'
and '</td>'
I want to find with Regular Expressions in python
How can I do it?
Use BeautifulSoup to parse HTML. Regex is the wrong tool; it works fine for this example but wouldn't scale well to a full document.
>>> from bs4 import BeautifulSoup
>>> html = '<td align="left" nowrap="nowrap">John 23</td>'
>>> BeautifulSoup(html).find("td").text
'John 23'