Answer the question
In order to leave comments, you need to log in
How to correctly parse the number of deliveries?
In general, I'm trying to get this
using this code
req = requests.get(url, headers=headers)
soup = BeautifulSoup(req.content,'lxml')
try:
filtr = soup.find('div',{'data-testid':'delivery-badge'}, class_ = 'css-uvtelg')
except:
filtr = ''
print(filtr)
Answer the question
In order to leave comments, you need to log in
That part of the site where successful deliveries are indicated is not parsed through requests. apparently generated using JS
This is what requests.get receives
Are you sure that you need to write this way
BeautifulSoup(req.content,'lxml')
and not
BeautifulSoup(req.content,'html.parser')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question