I am trying to parse this site https://www.dibbs.bsm.dla.mil/RFQ/RfqRecs.aspx?category=issue&TypeSrch=dt&Value=09-07-2017
using the following code
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
import ssl
context = ssl._create_unverified_context()
dibbsurl = 'https://www.dibbs.bsm.dla.mil/RFQ/RfqRecs.aspx?category=issue&TypeSrch=dt&Value=09-07-2017'
uClient = uReq(dibbsurl, context=context)
dibbshtml = uClient.read()
uClient.close()
#html parser
dibbssoup = soup(dibbshtml, "html.parser")
#grabs each rfq
containers = dibbssoup.findAll("tr",{"Class":"Bgwhite"})
I want to grab the National Stock Numbers, the Nomenclature and QTY from the table for research purposes.
containers = dibbssoup.findAll("tr",{"Class":"Bgwhite"})
I was trying to grab each row of the table but containers does not seem to be grabing it. when I type len(containers) it shows 0 why is the table not being grabbed and how can I fix it?
update this is the sample html from the site
<tr class="BgWhite">
<td headers="th0" valign="top">
1
</td>
<td headers="th1" style="width: 125px;" valign="top">
<a href="https://www.dibbs.bsm.dla.mil/RFQ/RFQNsn.aspx?value=8465015550093&category=issue&Scope=" title="go to NSN view">8465-01-555-0093</a>
</td>
<td headers="th2" valign="top">
SNAP LINK, RAPPELLER
</td>
<td headers="th3" valign="top">
None
</td>
<td headers="th4" style="width: 150px;" valign="top">
<a href="https://dibbs2.bsm.dla.mil/Downloads/RFQ/8/SPE1C117T2608.PDF" title="RFQ document" target="DIBBSDocuments">SPE1C1-17-T-2608</a><br> <span style="font-size: 9px; color: #505050;">» <a href="https://www.dibbs.bsm.dla.mil/rfq/rfqrec.aspx?sn=SPE1C117T2608" title="Package View" class="SubMenuLink">Package View</a></span><a href="https://www.dibbs.bsm.dla.mil/RFQ/RFQQHlp.aspx?ht=fi"><img src="https://www.dibbs.bsm.dla.mil/app_themes/images/icons/iconFastPace.gif" alt="Fast Award Candidate. Micro-purchase quotes may be awarded prior to the solicitation return date. See Master Solicitation for Additional Info" width="14" height="11" hspace="0" border="0" align="middle"></a><br><img src="https://www.dibbs.bsm.dla.mil/app_themes/images/icons/iconEproc.gif" width="36" height="16" hspace="1" border="0" alt="DLA E-Procurement" style="border-width:0px; vertical-align: bottom;">
</td>
<td headers="th5" valign="top">
<span style="color:#000099">Open</span><br><a href="https://www.dibbs.bsm.dla.mil/RA/Quote/QuoteFrm.aspx?sn=SPE1C117T2608"><img src="https://www.dibbs.bsm.dla.mil/app_themes/images/buttons/btnQ.gif" width="18" height="18" border="0" alt="Click to submit Quote" hspace="1" align="bottom"></a><a href="https://www.dibbs.bsm.dla.mil/RA/Quote/QuoteFrm.aspx?sn=SPE1C117T2608"><span style="font-size: 9px;">uote</span></a> <img src="https://www.dibbs.bsm.dla.mil/app_themes/images/icons/iconSpace1010.gif" alt=" " width="18" height="16" hspace="0" border="0">
</td>
<td headers="th6" valign="top">
0070631319<br>QTY: 400
</td>
<td headers="th7" valign="top">
09-07-2017
</td>
<td headers="th8" valign="top">
09-18-2017
</td>
</tr>