This is my first introduction to both Python and BeautifulSoup. I am trying to scrape the current bid amount from a specific property listed on a popular auction website (RealInsight), but I can not get BeautifulSoup to pull the actual integer I am looking for, only the HTML code. I am looking for the value of the "s-b-n" class tag, which is $3,250,000 until the auction actually starts.
https://marketplace.realinsight.com/sales/details/367
I think this is because the value is dynamically updating and is being generated outside of the HTML code, but I'm not sure how to validate that thesis or get the value if that proves correct. I also think I might bot be referencing the table in which the value is contained correctly, but again, not very experienced in python or bs4.
My code is below:
import bs4
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
my_url = 'https://marketplace.realinsight.com/sales/details/367'
uclient = uReq(my_url)
page_html = uclient.read()
uclient.close()
page_soup = soup(page_html, "html.parser")
bids = page_soup.findAll("td",{"class":"s-b-n"})
print(bids[0])
'generates "<td class="s-b-n"></td>"
print(bids[0].contents)
'generates "[]"
I can see the number I am looking for ($3,250,000) within the HTML code, but it flashes and updates every few seconds, which is why I think it is generated elsewhere.
Any guidance would be greatly appreciated.
Aucun commentaire:
Enregistrer un commentaire