I'm trying to get all the text for a specific class, but it is returning an empty list:
>>> soup.find_all(' dataRow odd')
[]
html:
<tr class=" dataRow odd" onblur="if (window.hiOff){hiOff(this);}"
onfocus="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}"
onmouseover="if (window.hiOn){hiOn(this);}"><td class='actionColumn'> </td><th scope="row" class=" dataCell ">
<a href="/a0I9000000hHJIN?btdid=0019000001piFE9">textexttext</a></th><td class=" dataCell ">Active</td><td class=" dataCell ">
<a href="/a089000001nOvG8?btdid=0019000001piFE9">BIG TEXT/a></td>
<td class=" dataCell ">TEXTTEXTTEXT</td><td class=" dataCell ">TEXTTEXTTEXT</td>
<td class=" dataCell "> </td><td class=" dataCell "> </td><td class=" dataCell DateElement">8/02/2019</td></tr>
I'm trying to grab ALL text within that code.
But when I run my code it returns []
as if it didn't find anything.
import requests, bs4, re
html = open('2.html')
soup = bs4.BeautifulSoup(exampleFile, "lxml")
duh = soup .find_all(' dataRow odd')
print (duh)
Where am I going wrong? Also, ideally the code would spit out all the separate text on different lines