I'm pretty new using BeautifulSoup because I want to buy 2 new ram memories so I go to the web that I use to watch the prices of the components in a lot of stores, but I want to extract all the information about the prices of all the products, and if 2 or more of them are in the same store, save it in a txt file.
This is the page that i use https://www.solotodo.cl ,so when I add the product staff to the url
and get it into the code the table tag did't appear when i use the find_all() function
- hrefs is a list of all product links
- url_base is the first url
for i in hrefs:
respond=requests.get(url_base+i)
sopa=BeautifulSoup(respond.text,'html.parser')
tabla=soup.find('table',{"class":"table table-sm mb-0"})
print(tabla)
Then when it is printed in the console only these parentheses are shown []
So I wanted to check if everything was in order, the only thing I did was go to the parent div to see if I could do something from there, but when it was time to print it by console, the whole part of the table did not appear
for i in hrefs:
respond=requests.get(link_base+i)
sopa=BeautifulSoup(respond.text,'html.parser')
tabla=sopa.find("div",{"class":"content-card","id":"product-prices-table"})
print(tabla)
this is what i see
<div class="content-card" id="product-prices-table"><div class="d-flex justify-content-end flex-wrap"><div class="mt-2"><butt...
the problem is that between the first two tags should be the table tag, something like this
<div class = "content-card" ...> <table class = "table table-sm mb-0"> < div ...>
So my question:
- what should I do to manipulate the table? use another library?
- trying another way?